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

Add native support for Catch2 XML output #100

Closed
cschreib opened this issue May 28, 2023 · 1 comment · Fixed by #111
Closed

Add native support for Catch2 XML output #100

cschreib opened this issue May 28, 2023 · 1 comment · Fixed by #111
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cschreib
Copy link
Member

cschreib commented May 28, 2023

In a standard build, snitch currently only offers the default reporter. This is human-readable, but not very machine-readable. Other testing frameworks support a machine-readable output (typically XML) so that IDEs and other CI frameworks can understand the output of the framework and display it in their respective UIs.

In Catch2 this is enabled with --reporter xml. The format doesn't appear to be documented, but can be reverse engineered from the source code. Since snitch claims to implement (most of) the Catch2 API, we should probably support the same CLI interface, so that snitch test executables can work in all IDEs and CI frameworks where Catch2 is supported.

Some background discussions:

@cschreib cschreib added the enhancement New feature or request label May 28, 2023
@cschreib cschreib added this to the v1.2 milestone May 28, 2023
@cschreib cschreib self-assigned this Jul 26, 2023
@cschreib cschreib linked a pull request Aug 12, 2023 that will close this issue
@cschreib
Copy link
Member Author

cschreib commented Aug 20, 2023

@nlohmann You had requested this feature. Good news: the xml_report branch now implements the Catch2 command-line API and XML reporter, so the Catch2 integration in CLion (and other IDEs) should work for snitch too. I have been able to test this with a demo license of CLion (which expires tomorrow), but only in a limited way as I don't really have a workflow in CLion. If you have the chance, could you give it a shot and let me know if it worked to your expectations?

NB: all my attempts to get Catch2 tests to appear in Visual Studio Professional 2022 have failed... Looks like Catch2 integrations aren't as polished as the GTest ones; makes me wonder if supporting the GTest command-line and reporter format would have been a smarter move...

Edit: Actually I got it! I was missing a few critical things ;) I would still appreciate more testing and feedback on the CLion integration though, since I'm not able to test them anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant