Skip to content

ctest: add option for output truncation

Frank Winklmeier requested to merge fwinkl/cmake:ctest_truncate into master

Add --test-output-truncation to ctest. This option can be used to customize which part of the test output is being truncated. Currently supported values are tail, middle and head. Also add equivalent CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION variable.

Example output from --test-output-truncation middle:

12...
[This part of the test output was removed since it exceeds the threshold of 5 bytes.]
...89

Note that the truncation message is slightly different than before (this also applies for the default "tail" setting). But no changes were required to the existing unit test, and hopefully nobody is relying on the exact wording of that message.

Fixes: #23206 (closed)

Edited by Frank Winklmeier

Merge request reports