diff options
author | Craig Scott <craig.scott@crascit.com> | 2022-09-06 12:35:45 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-09-06 12:35:56 (GMT) |
commit | df05616085f93adf9bc3dc2992b30fdc17454c29 (patch) | |
tree | 878795957f790bbe77cd9a079ed6f29c05c3b952 /Tests | |
parent | 4758d4e86808d0c782f0fa0d162b4e9aff2f2f59 (diff) | |
parent | cb55d5e730f8f40c2ba5ecf4771575117c56ef0c (diff) | |
download | CMake-df05616085f93adf9bc3dc2992b30fdc17454c29.zip CMake-df05616085f93adf9bc3dc2992b30fdc17454c29.tar.gz CMake-df05616085f93adf9bc3dc2992b30fdc17454c29.tar.bz2 |
Merge topic 'truncation_test'
cb55d5e730 RunCMakeTest: fix Truncation test definition
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7632
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/TestOutputTruncation_head-check.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/TestOutputTruncation_head-stderr.txt (renamed from Tests/RunCMake/CTestCommandLine/TestOutputTruncation-stderr.txt) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-check.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-check.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_test/RunCMakeTest.cmake | 19 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_test/TestOutputTruncation_head-check.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_test/TestOutputTruncation_middle-check.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ctest_test/TestOutputTruncation_tail-check.cmake | 1 |
11 files changed, 18 insertions, 11 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 8ac1747..2ac1f36 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -284,7 +284,7 @@ function(run_TestOutputTruncation mode expected) file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " add_test(Truncation_${mode} \"${CMAKE_COMMAND}\" -E echo 123456789) ") - run_cmake_command(TestOutputTruncation + run_cmake_command(TestOutputTruncation_${mode} ${CMAKE_CTEST_COMMAND} -M Experimental -T Test --no-compress-output --test-output-size-passed 5 diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_head-check.cmake b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_head-check.cmake new file mode 100644 index 0000000..6065c30 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_head-check.cmake @@ -0,0 +1 @@ +include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake) diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputTruncation-stderr.txt b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_head-stderr.txt index 30b46ce..30b46ce 100644 --- a/Tests/RunCMake/CTestCommandLine/TestOutputTruncation-stderr.txt +++ b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_head-stderr.txt diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-check.cmake b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-check.cmake new file mode 100644 index 0000000..6065c30 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-check.cmake @@ -0,0 +1 @@ +include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake) diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-stderr.txt b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-stderr.txt new file mode 100644 index 0000000..30b46ce --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_middle-stderr.txt @@ -0,0 +1 @@ +^Cannot find file: .*/Tests/RunCMake/CTestCommandLine/TestOutputTruncation.*/DartConfiguration.tcl diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-check.cmake b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-check.cmake new file mode 100644 index 0000000..6065c30 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-check.cmake @@ -0,0 +1 @@ +include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake) diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-stderr.txt b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-stderr.txt new file mode 100644 index 0000000..30b46ce --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/TestOutputTruncation_tail-stderr.txt @@ -0,0 +1 @@ +^Cannot find file: .*/Tests/RunCMake/CTestCommandLine/TestOutputTruncation.*/DartConfiguration.tcl diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake index b41c271..1aa6359 100644 --- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake @@ -84,18 +84,17 @@ run_TestOutputSize() function(run_TestOutputTruncation mode expected) set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion) set(TRUNCATED_OUTPUT ${expected}) # used in TestOutputTruncation-check.cmake - set(CASE_TEST_PREFIX_CODE [[ -set( CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION${mode}) - ]]) - set(CASE_CMAKELISTS_SUFFIX_CODE [[ -add_test(NAME Truncation_${mode} COMMAND ${CMAKE_COMMAND} -E echo 123456789) - ]]) + string(CONCAT CASE_TEST_PREFIX_CODE " +set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 5) +set(CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION ${mode})" ) + set(CASE_CMAKELISTS_SUFFIX_CODE " +add_test(NAME Truncation_${mode} COMMAND \${CMAKE_COMMAND} -E echo 123456789)") - run_ctest(TestOutputTruncation) + run_ctest(TestOutputTruncation_${mode}) endfunction() -run_TestOutputTruncation("head" "...6789") -run_TestOutputTruncation("middle" "12....*...89") -run_TestOutputTruncation("tail" "12345...") +run_TestOutputTruncation("head" "\\.\\.\\.6789") +run_TestOutputTruncation("middle" "12\\.\\.\\..*\\.\\.\\.89") +run_TestOutputTruncation("tail" "12345\\.\\.\\.") run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3) run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1) diff --git a/Tests/RunCMake/ctest_test/TestOutputTruncation_head-check.cmake b/Tests/RunCMake/ctest_test/TestOutputTruncation_head-check.cmake new file mode 100644 index 0000000..6065c30 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestOutputTruncation_head-check.cmake @@ -0,0 +1 @@ +include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake) diff --git a/Tests/RunCMake/ctest_test/TestOutputTruncation_middle-check.cmake b/Tests/RunCMake/ctest_test/TestOutputTruncation_middle-check.cmake new file mode 100644 index 0000000..6065c30 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestOutputTruncation_middle-check.cmake @@ -0,0 +1 @@ +include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake) diff --git a/Tests/RunCMake/ctest_test/TestOutputTruncation_tail-check.cmake b/Tests/RunCMake/ctest_test/TestOutputTruncation_tail-check.cmake new file mode 100644 index 0000000..6065c30 --- /dev/null +++ b/Tests/RunCMake/ctest_test/TestOutputTruncation_tail-check.cmake @@ -0,0 +1 @@ +include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake) |