Add unit test and conversion test in CMake