diff options
author | Frank Winklmeier <frank.winklmeier@cern.ch> | 2022-09-05 11:42:40 (GMT) |
---|---|---|
committer | Frank Winklmeier <frank.winklmeier@cern.ch> | 2022-09-05 11:42:40 (GMT) |
commit | cb55d5e730f8f40c2ba5ecf4771575117c56ef0c (patch) | |
tree | 7112707c7d00f249840315ababc64fef299633dd /Tests/RunCMake/CTestCommandLine | |
parent | 0e7bb4e783f596a1995d3a713682e6a54a41781e (diff) | |
download | CMake-cb55d5e730f8f40c2ba5ecf4771575117c56ef0c.zip CMake-cb55d5e730f8f40c2ba5ecf4771575117c56ef0c.tar.gz CMake-cb55d5e730f8f40c2ba5ecf4771575117c56ef0c.tar.bz2 |
RunCMakeTest: fix Truncation test definition
The `ctest_test` and `CTestCommandLine` truncation tests had multiple problems:
- escape expected result string to avoid regex matching
- specify the truncation size
- pass the truncation mode correctly into the test definition
- use unique test names
Issue: #23868
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine')
-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 |
7 files changed, 6 insertions, 1 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 |