-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit f24569a
committed
Large output redirect refactor
This rework changes two important things
1) the output redirect is deactivated while control is given to the reporters.
This means that combining reporters that write to stdout with capturing
reporters, e.g. `./tests -s -r console -r junit::out=junit.xml`, no
longer leads to the capturing reporter seeing all the output from
the other reporter captured.
Trying this with the `SelfTest` binary would previously lead to JUnit
spending **hours** trying to escape all of ConsoleReporter's output and
write it to the output file. I actually ended up killing the process
after 3 hours, during which the JUnit reporter wrote something like 50 MBs
of output to a file.
2) The redirect object's lifetime is tied to the `RunContext`, instead
of being constructed for every partial test case run separately.
This has no effect on the basic StreamRedirect, but improves the FileRedirect
significantly. Previously, running many tests in single process with this
redirect (e.g. running `SelfTest -r junit`) would cause later tests to
always fail before starting, due to exceeding the limit of temporary files.
For the current `SelfTest` binary, the old implementation would lead to
**295** test failures from not being able to initiate the redirect. The
new implementation completely eliminates them.
----
There is one downside to the new implementation of FileRedirect, specific
to Linux. Running the `SelfTest` binary on Linux causes 3-4 tests to have
no captured stdout/stderr, even though the tests were supposed to be
writing there (there was no output to the actual stdout/stderr either,
the output was just completely lost).
Since this never happen for smaller test case sets, nor does it reproduce
on other platforms, this implementation is still strictly better than
the old one, and thus it can get reasonably merged.1 parent a579b5f commit f24569aCopy full SHA for f24569a
File tree
4 files changed
+387
-215
lines changedFilter options
- src/catch2/internal
4 files changed
+387
-215
lines changed
0 commit comments