Tests: Move ctest --print-labels case into RunCMake.CTestCommandLine

This commit is contained in:
Brad King
2024-07-24 09:37:28 -04:00
parent 53de9d9943
commit 8f6092fc20
3 changed files with 20 additions and 5 deletions

View File

@@ -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"

View File

@@ -0,0 +1,6 @@
^Test project [^
]*/Tests/RunCMake/CTestCommandLine/PrintLabels
All Labels:
Label1
Label2
Label3$

View File

@@ -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
)