summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 7da95a2..5b198bd 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -274,6 +274,27 @@ function(run_TestOutputSize)
endfunction()
run_TestOutputSize()
+# Test --test-output-truncation
+function(run_TestOutputTruncation mode expected)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestOutputTruncation_${mode})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(TRUNCATED_OUTPUT ${expected}) # used in TestOutputTruncation-check.cmake
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+ add_test(Truncation_${mode} \"${CMAKE_COMMAND}\" -E echo 123456789)
+")
+ run_cmake_command(TestOutputTruncation
+ ${CMAKE_CTEST_COMMAND} -M Experimental -T Test
+ --no-compress-output
+ --test-output-size-passed 5
+ --test-output-truncation ${mode}
+ )
+endfunction()
+run_TestOutputTruncation("head" "\\.\\.\\.6789")
+run_TestOutputTruncation("middle" "12\\.\\.\\..*\\.\\.\\.89")
+run_TestOutputTruncation("tail" "12345\.\.\.")
+
# Test --stop-on-failure
function(run_stop_on_failure)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/stop-on-failure)