From 37e92fae394def0e8bd7fef75c306c2e50908c90 Mon Sep 17 00:00:00 2001 From: mobounya Date: Sat, 13 Jan 2024 21:43:17 +0100 Subject: [PATCH] Document output redirecion changes. Document the changes for the previous two commit in the 5.11.0-M1 release notes and in the user guide. Issue: #3166 --- .../docs/asciidoc/release-notes/release-notes-5.11.0-M1.adoc | 4 +++- .../src/docs/asciidoc/user-guide/running-tests.adoc | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.0-M1.adoc index 5e6ade320218..d01e4b4b9002 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.11.0-M1.adoc @@ -30,7 +30,9 @@ repository on GitHub. -- for use in third-party extensions and test engines. * Error messages for type mismatches in `NamespacedHierarchicalStore` now include the actual type and value in addition to the required type. - +* New optional config parameter `junit.platform.output.capture.merge` that can be used to merge stdout and stderr and + capture it as stdout. +* New optional CLI options `--redirect-stdout` and `--redirect-stderr` to redirect stdout and stderr outputs to a file. [[release-notes-5.11.0-M1-junit-jupiter]] === JUnit Jupiter diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index 1900545858fc..dc1f234ea42d 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -1019,6 +1019,8 @@ expressions can be useful. Since version 1.3, the JUnit Platform provides opt-in support for capturing output printed to `System.out` and `System.err`. To enable it, set the `junit.platform.output.capture.stdout` and/or `junit.platform.output.capture.stderr` +<> to `true`. And since version 5.11 +you can capture a merged stdout/stderr output by setting the `junit.platform.output.capture.merge` <> to `true`. In addition, you may configure the maximum number of buffered bytes to be used per executed test or container using `junit.platform.output.capture.maxBuffer`. @@ -1026,7 +1028,8 @@ using `junit.platform.output.capture.maxBuffer`. If enabled, the JUnit Platform captures the corresponding output and publishes it as a report entry using the `stdout` or `stderr` keys to all registered `{TestExecutionListener}` instances immediately before reporting the test or container as -finished. +finished, in case of a `junit.platform.output.capture.merge` <>, +the merged output will be published as a report entry using the `stdout` key. Please note that the captured output will only contain output emitted by the thread that was used to execute a container or test. Any output by other threads will be omitted