Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple reporters for catch_discover_tests #2824

Open
brianjmaher opened this issue Feb 25, 2024 · 1 comment
Open

Support multiple reporters for catch_discover_tests #2824

brianjmaher opened this issue Feb 25, 2024 · 1 comment
Labels
Extras Touches utility scripts outside of Catch2 proper, e.g. CMake integration.

Comments

@brianjmaher
Copy link

brianjmaher commented Feb 25, 2024

Description
When running Catch2 tests from the command line, it's possible to specify and configure multiple reporters, e.g. console with colors and JUnit, to make it easy to for a human to use console output and easy for a CI/CD system to digest JUnit results. However, when using the catch_discover_tests CMake utility, only one reporter can be provided. Is it possible it could be extended to support multiple reporters, or have some other way to get both colorful console output and JUnit output?

@horenmar horenmar added the Extras Touches utility scripts outside of Catch2 proper, e.g. CMake integration. label Feb 27, 2024
@horenmar
Copy link
Member

If anyone wants to poke into this, note that to have multiple reporters active, they have to have different output destinations, or use the extended reporter specification to explicitly target the same output. Currently discover_tests only accepts one reporter and either lets it write to stdout, or it generates output filename for the tests based on the tests's name and prefix/suffix/folder arguments to the script.

For a general solution for N reporters, the script would have to accept "templated" reporter specs and understand how to rewrite them for the actual tests. For solution specific to this issue, there would likely need to be an extra argument along the lines of STDOUT_REPORTER, that would be handled specially to target stdout, and the default REPORTER argument would keep the current semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extras Touches utility scripts outside of Catch2 proper, e.g. CMake integration.
Projects
None yet
Development

No branches or pull requests

2 participants