Tests: Add cases covering bad ctest output truncation types

Issue: #23869
This commit is contained in:
Brad King
2022-09-07 12:21:26 -04:00
parent dbf840392d
commit bd30d20bc3
7 changed files with 10 additions and 0 deletions

View File

@@ -294,6 +294,7 @@ endfunction()
run_TestOutputTruncation("head" "\\.\\.\\.6789")
run_TestOutputTruncation("middle" "12\\.\\.\\..*\\.\\.\\.89")
run_TestOutputTruncation("tail" "12345\\.\\.\\.")
run_TestOutputTruncation("bad" "")
# Test --stop-on-failure
function(run_stop_on_failure)

View File

@@ -0,0 +1 @@
^CMake Error: Invalid value for '--test-output-truncation': bad$

View File

@@ -95,6 +95,7 @@ endfunction()
run_TestOutputTruncation("head" "\\.\\.\\.6789")
run_TestOutputTruncation("middle" "12\\.\\.\\..*\\.\\.\\.89")
run_TestOutputTruncation("tail" "12345\\.\\.\\.")
run_TestOutputTruncation("bad" "")
run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3)
run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1)

View File

@@ -0,0 +1,4 @@
file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
if(test_xml_file)
set(RunCMake_TEST_FAILED "Test.xml should not exist:\n ${test_xml_file}")
endif()

View File

@@ -0,0 +1 @@
[^0]

View File

@@ -0,0 +1 @@
^Invalid value for CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION: bad$