diff --git a/08_ctest/CMakeLists.txt b/08_ctest/CMakeLists.txt index 768812e78b324f32a1c5874e2bce0c9035da84b5..e1f8c8a8826dec33f60a211ea688ff0bf79cb5b6 100644 --- a/08_ctest/CMakeLists.txt +++ b/08_ctest/CMakeLists.txt @@ -8,6 +8,10 @@ add_executable(success success.cpp) # create an executable that returns failure add_executable(failure failure.cpp) +# Tests in this subdirectory will never be called since CTest is not yet +# included! +add_subdirectory(tests) + # Make sure to include CTest before adding any test with add_test # otherwise the tests will not be registered. include(CTest) diff --git a/08_ctest/tests/CMakeLists.txt b/08_ctest/tests/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..fb3d04917c3f4f36ea90d22775cba44d26322fca --- /dev/null +++ b/08_ctest/tests/CMakeLists.txt @@ -0,0 +1,6 @@ +add_executable(never_run never_run.cpp) + +add_test( + NAME never_run + COMMAND never_run ) + diff --git a/08_ctest/tests/never_run.cpp b/08_ctest/tests/never_run.cpp new file mode 100644 index 0000000000000000000000000000000000000000..859e6538ca286c2078e79bbe0f033c838d889cd9 --- /dev/null +++ b/08_ctest/tests/never_run.cpp @@ -0,0 +1,6 @@ +#include <cstdlib> + +int main() +{ + return EXIT_SUCCESS; +}