summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-26 15:14:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-26 15:14:58 (GMT)
commitd9b9f630832174c2b6ee31d8a06f6e587ab2dd84 (patch)
tree2e9096991944408275534306f4d9573e75d4d83e /Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
parent409ab01039dd3c8f5ae0df48a1ee1c356132a9bf (diff)
parent701029726f17759a84b963e2f318742a1761670a (diff)
downloadCMake-d9b9f630832174c2b6ee31d8a06f6e587ab2dd84.zip
CMake-d9b9f630832174c2b6ee31d8a06f6e587ab2dd84.tar.gz
CMake-d9b9f630832174c2b6ee31d8a06f6e587ab2dd84.tar.bz2
Merge topic 'ctest-tests-from-file'
701029726f ctest_test: add options INCLUDE_FROM_FILE and EXCLUDE_FROM_FILE dbacc1d5a8 ctest: add command line option to exclude tests listed in a given file 022f20f663 ctest: add command line option to run the tests listed in a given file Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Alex <leha-bot@yandex.ru> Merge-request: !9128
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 1b8d0d9..c09fff8 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -207,6 +207,24 @@ set_tests_properties(test1 PROPERTIES SKIP_REGULAR_EXPRESSION \"test1\")
endfunction()
run_SkipRegexFoundTest()
+
+function(run_TestsFromFileTest arg)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestsFromFile)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(Test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+add_test(Test2 \"${CMAKE_COMMAND}\" -E echo \"test2\")
+add_test(Test11 \"${CMAKE_COMMAND}\" -E echo \"test11\")
+")
+ run_cmake_command(TestsFromFile-${arg} ${CMAKE_CTEST_COMMAND} --${arg} ${RunCMake_SOURCE_DIR}/TestsFromFile-TestList.txt )
+endfunction()
+run_TestsFromFileTest(tests-from-file)
+run_TestsFromFileTest(exclude-from-file)
+
+
function(run_SerialFailed)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SerialFailed)
set(RunCMake_TEST_NO_CLEAN 1)