diff options
Diffstat (limited to 'Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake b/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake new file mode 100644 index 0000000..f13289a --- /dev/null +++ b/Tests/RunCMake/ctest_fixtures/RunCMakeTest.cmake @@ -0,0 +1,36 @@ +include(RunCTest) + +# Isolate our ctest runs from external environment. +unset(ENV{CTEST_PARALLEL_LEVEL}) +unset(ENV{CTEST_OUTPUT_ON_FAILURE}) + +function(run_ctest_test CASE_NAME) + set(CASE_CTEST_FIXTURES_ARGS "${ARGN}") + run_ctest(${CASE_NAME}) +endfunction() + +#------------------------------------------------------------ +# CMake configure will pass +#------------------------------------------------------------ +run_ctest_test(one INCLUDE one) +run_ctest_test(two INCLUDE two) +run_ctest_test(three INCLUDE three) +run_ctest_test(setupFoo INCLUDE setupFoo) +run_ctest_test(wontRun INCLUDE wontRun) + +#------------------------------------------------------------ +# CMake configure will fail due to cyclic test dependencies +#------------------------------------------------------------ +set(CASE_CMAKELISTS_CYCLIC_CODE [[ + set_tests_properties(cyclicSetup PROPERTIES + FIXTURES_SETUP "Foo" + FIXTURES_REQUIRED "Foo") +]]) +run_ctest(cyclicSetup) + +set(CASE_CMAKELISTS_CYCLIC_CODE [[ + set_tests_properties(cyclicCleanup PROPERTIES + FIXTURES_CLEANUP "Foo" + FIXTURES_REQUIRED "Foo") +]]) +run_ctest(cyclicCleanup) |