Skip to content

Commit 3d92bd6

Browse files
committed
Overhaul and move STDOUT/STDERR redirect documentation to correct section
Prior to this commit, the STDOUT/STDERR redirect documentation was incorrectly displayed in the "Open Test Reporting" section. See #3166 See #4311
1 parent 68d93ea commit 3d92bd6

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

documentation/src/docs/asciidoc/user-guide/advanced-topics/junit-platform-reporting.adoc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,6 @@ $ java -jar junit-platform-console-standalone-{platform-version}.jar <OPTIONS> \
154154
--config-resource=configuration.properties
155155
----
156156

157-
You can redirect standard output and standard error using the `--redirect-stdout` and
158-
`--redirect-stderr` options:
159-
160-
[source,console,subs=attributes+]
161-
----
162-
$ java -jar junit-platform-console-standalone-{platform-version}.jar <OPTIONS> \
163-
--redirect-stdout=foo.txt \
164-
--redirect-stderr=bar.txt
165-
----
166-
167-
If both the `--redirect-stdout` and `--redirect-stderr` parameters point to the same
168-
file, the output will be merged into that file.
169-
170-
The default charset is used for writing to the files.
171-
172157
[[junit-platform-reporting-legacy-xml]]
173158
==== Legacy XML format
174159

documentation/src/docs/asciidoc/user-guide/running-tests.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,27 @@ You can pass a real parameter with an initial `@` character by escaping it with
812812
additional `@` symbol. For example, `@@somearg` will become `@somearg` and will not be
813813
subject to expansion.
814814

815+
[[running-tests-console-launcher-redirecting-stdout-and-stderr]]
816+
==== Redirecting Standard Output/Error to Files
817+
818+
You can redirect the `System.out` (stdout) and `System.err` (stderr) output streams to
819+
files using the `--redirect-stdout` and `--redirect-stderr` options:
820+
821+
[source,console,subs=attributes+]
822+
----
823+
$ java -jar junit-platform-console-standalone-{platform-version}.jar <OPTIONS> \
824+
--redirect-stdout=stdout.txt \
825+
--redirect-stderr=stderr.txt
826+
----
827+
828+
[NOTE]
829+
====
830+
If the `--redirect-stdout` and `--redirect-stderr` arguments point to the same file, both
831+
output streams will be redirected to that file.
832+
833+
The default charset is used for writing to the files.
834+
====
835+
815836
[[running-tests-console-launcher-color-customization]]
816837
==== Color Customization
817838

0 commit comments

Comments
 (0)