summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-29 12:44:13 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-29 12:44:27 (GMT)
commit5f1afff9f79784d59618abc16d8e56a3c5f3f1e3 (patch)
tree356a8a776b2040d4c26ff1795b3639660d2647b5 /Tests
parentb880867e5aa4037d5fca4c3aafa82ffe60d18dfa (diff)
parent26170ea3069238bfb287d6304cd2f65e1c3a7387 (diff)
downloadCMake-5f1afff9f79784d59618abc16d8e56a3c5f3f1e3.zip
CMake-5f1afff9f79784d59618abc16d8e56a3c5f3f1e3.tar.gz
CMake-5f1afff9f79784d59618abc16d8e56a3c5f3f1e3.tar.bz2
Merge topic 'ctest-test-changing-labels' into release-3.21
26170ea306 CTest: Reset multi-options to persistent multi-options Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6403
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake13
-rw-r--r--Tests/RunCMake/ctest_test/test.cmake.in7
2 files changed, 19 insertions, 1 deletions
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index f07a12b..5f9b32d 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -181,3 +181,16 @@ add_test(
run_ctest(TestCompletionStatus)
endfunction()
run_completion_status()
+
+# Verify that running ctest_test() multiple times with different label arguments
+# doesn't break.
+function(run_changing_labels)
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME a COMMAND ${CMAKE_COMMAND} -E true)
+set_property(TEST a PROPERTY LABELS a)
+add_test(NAME b COMMAND ${CMAKE_COMMAND} -E true)
+set_property(TEST b PROPERTY LABELS b)
+ ]])
+ run_ctest(TestChangingLabels)
+endfunction()
+run_changing_labels()
diff --git a/Tests/RunCMake/ctest_test/test.cmake.in b/Tests/RunCMake/ctest_test/test.cmake.in
index 50b936d..36b1dbd 100644
--- a/Tests/RunCMake/ctest_test/test.cmake.in
+++ b/Tests/RunCMake/ctest_test/test.cmake.in
@@ -15,4 +15,9 @@ set(ctest_test_args "@CASE_CTEST_TEST_ARGS@")
ctest_start(Experimental)
ctest_configure()
ctest_build()
-ctest_test(${ctest_test_args})
+if("@CASE_NAME@" STREQUAL "TestChangingLabels")
+ ctest_test(${ctest_test_args} INCLUDE_LABEL "^a$")
+ ctest_test(${ctest_test_args} INCLUDE_LABEL "^b$")
+else()
+ ctest_test(${ctest_test_args})
+endif()