[CMake] Unit testing in CMake

Eric NOULARD eric.noulard at gmail.com
Mon Nov 24 17:35:49 EST 2008


Le Mon, 24 Nov 2008 16:06:06 -0600,
"Robert Dailey" <rcdailey at gmail.com> a écrit :

> Hi,
> 
> I'm reading this wiki
> article<http://www.cmake.org/Wiki/CMake_Testing_With_CTest>on how to
> perform tests using CMake. However, the tests I'm wanting to run
> aren't already built. I need to be able to use CMake to first compile
> the test and then run it afterwards. How would I handle this behavior
> in CMake? Would I simply call add_executable() before calling
> add_test()?

Yes exactly.
Usually the only difference between an "usual" executable
and a test executable, is that you often does not
have a corresponding

install() rule for the test executable.


-- 
Erk


More information about the CMake mailing list