approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
312 stars 51 forks source link

Passing tests don't register in Catch2 and other test frameworks #148

Closed barneydellar closed 3 years ago

barneydellar commented 4 years ago

If I have a test such as

ApprovalTests::Approvals::verify("Hello World");

then failures are reported correctly in Catch2, but when it passes, Catch2 reports that no asserts were encountered:

assertions: - none -

This is confusing :-(

claremacrae commented 4 years ago

Yes, so far our “how to wrap a test framework” does not include an abstraction for “tell the framework that a test has passed.”

https://approvaltestscpp.readthedocs.io/en/latest/generated_docs/SupportingNewTestFramework.html

I think we would have to some kind of extension point that triggers "test has passed" - and then hook up each of our existing test framework integrations to call that.

I do agree it would be nice to implement this.

claremacrae commented 3 years ago

If we could also make failing tests register in Catch2, then that project's --break command line argument would be really useful, to allow break on failure when run in a debugger.

claremacrae commented 3 years ago

This is done, and will be included in the upcoming release.

Thanks for the suggestion, @barneydellar