diff options
author | Brad King <brad.king@kitware.com> | 2024-07-24 13:37:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-07-24 14:07:35 (GMT) |
commit | 8f6092fc20015ac4afd38ab8067737a5b3eb35e7 (patch) | |
tree | 058b658743c3f5ace5bec01efc00f4bb25d82b59 | |
parent | 53de9d9943e0686249728d960741f0b874341001 (diff) | |
download | CMake-8f6092fc20015ac4afd38ab8067737a5b3eb35e7.zip CMake-8f6092fc20015ac4afd38ab8067737a5b3eb35e7.tar.gz CMake-8f6092fc20015ac4afd38ab8067737a5b3eb35e7.tar.bz2 |
Tests: Move ctest --print-labels case into RunCMake.CTestCommandLine
-rw-r--r-- | Tests/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/PrintLabels-stdout.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 14 |
3 files changed, 20 insertions, 5 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0ff2cdc..6e482cd 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -3078,11 +3078,6 @@ if(BUILD_TESTING) --output-on-failure -C "\${CTestTest_CONFIG}") endif() - add_test(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) - set_tests_properties(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") - set_tests_properties(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION - "All Labels:.* Label1.* Label2") - configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestLabelRegExp/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestLabelRegExp/test.cmake" diff --git a/Tests/RunCMake/CTestCommandLine/PrintLabels-stdout.txt b/Tests/RunCMake/CTestCommandLine/PrintLabels-stdout.txt new file mode 100644 index 0000000..21791aa --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/PrintLabels-stdout.txt @@ -0,0 +1,6 @@ +^Test project [^ +]*/Tests/RunCMake/CTestCommandLine/PrintLabels +All Labels: + Label1 + Label2 + Label3$ diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index c1c26ed..b2374ca 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -23,6 +23,20 @@ set_tests_properties(Long_Test_Name_That_Is_Over_Fifty_Characters_In_Length PROP run_cmake_command(FailureLabels ${CMAKE_CTEST_COMMAND}) endblock() +block() + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PrintLabels) + 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(A \"${CMAKE_COMMAND}\" -E true) +set_tests_properties(A PROPERTIES LABELS \"Label1;Label2\") +add_test(B \"${CMAKE_COMMAND}\" -E true) +set_tests_properties(B PROPERTIES LABELS \"Label3\") +") + run_cmake_command(PrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) +endblock() + run_cmake_command(repeat-opt-bad1 ${CMAKE_CTEST_COMMAND} --repeat until-pass ) |