summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorFrank Winklmeier <frank.winklmeier@cern.ch>2022-03-07 08:28:55 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-08 13:18:02 (GMT)
commit140704d443e73c2dc74ac8192a109ae0c21e834a (patch)
tree7781fb36c21aa925d0442daf27ec5344d89e76f9 /Help
parent359e5b17d8edd092a1e500698af7968f96fe1d8d (diff)
downloadCMake-140704d443e73c2dc74ac8192a109ae0c21e834a.zip
CMake-140704d443e73c2dc74ac8192a109ae0c21e834a.tar.gz
CMake-140704d443e73c2dc74ac8192a109ae0c21e834a.tar.bz2
ctest: add option for output truncation
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. Fixes: #23206
Diffstat (limited to 'Help')
-rw-r--r--Help/command/ctest_test.rst5
-rw-r--r--Help/manual/cmake-presets.7.rst6
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/manual/ctest.1.rst4
-rw-r--r--Help/manual/presets/schema.json25
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst3
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst3
-rw-r--r--Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst12
8 files changed, 54 insertions, 5 deletions
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 6a9a6a0..11ebdbd 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -172,8 +172,9 @@ The options are:
affected. Summary info detailing the percentage of passing tests is also
unaffected by the ``QUIET`` option.
-See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`
-and :variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` variables.
+See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`,
+:variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` and
+:variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variables.
.. _`Additional Test Measurements`:
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index 23057b9..26b9dbc 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -694,6 +694,12 @@ that may contain the following fields:
bytes. Equivalent to passing ``--test-output-size-failed`` on the
command line.
+ ``testOutputTruncation``
+
+ An optional string specifying the test output truncation mode. Equivalent
+ to passing ``--test-output-truncation`` on the command line."
+ This is allowed in preset files specifying version ``5`` or above.
+
``maxTestNameWidth``
An optional integer specifying the maximum width of a test name to
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 86e4d4c..956e918 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -636,6 +636,7 @@ Variables for CTest
/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
+ /variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION
/variable/CTEST_CUSTOM_MEMCHECK_IGNORE
/variable/CTEST_CUSTOM_POST_MEMCHECK
/variable/CTEST_CUSTOM_POST_TEST
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 1e7b077..82e27b8 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -362,6 +362,10 @@ Specify the directory in which to look for tests.
``--test-output-size-failed <size>``
Limit the output for failed tests to ``<size>`` bytes.
+``--test-output-truncation <mode>``
+ Truncate 'tail' (default), 'middle' or 'head' of test output once maximum
+ output size is reached.
+
``--overwrite``
Overwrite CTest configuration option.
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json
index ac7b1dd..c96405c 100644
--- a/Help/manual/presets/schema.json
+++ b/Help/manual/presets/schema.json
@@ -688,6 +688,28 @@
"additionalProperties": false
}
},
+ "testPresetsItemsV5": {
+ "type": "array",
+ "description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 5 and higher.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "output": {
+ "type": "object",
+ "description": "An optional object specifying output options.",
+ "properties": {
+ "testOutputTruncation": {
+ "type": "string",
+ "description": "An optional string specifying the test output truncation mode. Equivalent to passing --test-output-truncation on the command line. Must be one of the following values: \"tail\", \"middle\", or \"head\".",
+ "enum": [
+ "tail", "middle", "head"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
"testPresetsItemsV3": {
"type": "array",
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 3 and higher.",
@@ -1017,7 +1039,8 @@
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 5 and higher.",
"allOf": [
{ "$ref": "#/definitions/testPresetsItemsV2" },
- { "$ref": "#/definitions/testPresetsItemsV3" }
+ { "$ref": "#/definitions/testPresetsItemsV3" },
+ { "$ref": "#/definitions/testPresetsItemsV5" }
],
"items": {
"type": "object",
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
index 7e7d431..007cfe0 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
@@ -3,7 +3,8 @@ CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
When saving a failing test's output, this is the maximum size, in bytes, that
will be collected by the :command:`ctest_test` command. Defaults to 307200
-(300 KiB).
+(300 KiB). See :variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` for possible
+truncation modes.
If a test's output contains the literal string "CTEST_FULL_OUTPUT",
the output will not be truncated and may exceed the maximum size.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
index 64367f9..8545fc4 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
@@ -3,7 +3,8 @@ CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
When saving a passing test's output, this is the maximum size, in bytes, that
will be collected by the :command:`ctest_test` command. Defaults to 1024
-(1 KiB).
+(1 KiB). See :variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` for possible
+truncation modes.
If a test's output contains the literal string "CTEST_FULL_OUTPUT",
the output will not be truncated and may exceed the maximum size.
diff --git a/Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst b/Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst
new file mode 100644
index 0000000..2d4219e
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst
@@ -0,0 +1,12 @@
+CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION
+-----------------------------------
+
+.. versionadded:: 3.24
+
+Set the test output truncation mode in case a maximum size is configured
+via the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE` or
+:variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` variables.
+By default the ``tail`` of the output will be truncated. Other possible
+values are ``middle`` and ``head``.
+
+.. include:: CTEST_CUSTOM_XXX.txt