I can run a Catch executable with -o junit --output catch_results.xml
to generate an xml report.
Is there some way to both generate an xml report, and also have the console output?
I can run a Catch executable with -o junit --output catch_results.xml
to generate an xml report.
Is there some way to both generate an xml report, and also have the console output?
Assuming you are asking for having a JUnit output in a file and the standard console reporter at stdout, there is no way to do that.
Catch2 used to support multiple reporters, but there was no support for having them write their output to separate files/outputs, which meant that the feature was unusable and was removed until some point in the future.
You can implement your own Listener
.
A Listener
can implement 'event handlers' for certain events (test suite start/end, test case start/end, ...). In those event handlers you can output to the console (use printf
instead of cout
as cout
can be intercepted by the test runner).
And, most importantly, your Listener
can run in combination with a reporter.
https://github.com/catchorg/Catch2/blob/master/docs/event-listeners.md