[CMake] Testing in Windows

"Flávio P. Duarte" fduarte at gisplan.com.br
Fri Nov 24 12:28:53 EST 2006


Hi,
  I am using trying to build and test my application on both Linux and
Windows. Although everything is working as I planned on Linux, on
windows the tests are not the way I expected. My tests are made by
programs which are in the source tree. On linux, whenever I want to run
the tests, I can issue a "make check" and all the test programs are
compiled and executed. On windows I am not being able to accomplish
this. The RUN_TESTS rule does not try to compile the source files, it
only executes them. To compile the test programs on windows, I am having
to build one by one. The rules I am using right, which was taken as tip
in this list, is:
ADD_EXECUTABLE( test_1 test_1.cpp )
ADD_EXECUTABLE( test_2 test_2.cpp )
ADD_TEST( test_1 test_1 )
ADD_TEST( test_2 test_2 )
ADD_CUSTOM_TARGET( check ctest )
ADD_DEPENDENCIES( check
  test_1
  test_2
)

This rule works on linux, but not on windows. On windows it complains
about not find ctest. Removing ctest from ADD_CUSTOM_TARGET does not
help also. This time visual studio says "Project skipped because is not
selected in this solution configuration".
  Does anyone know how to deal with it ?

Flavio


More information about the CMake mailing list