1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
- #define TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
- namespace Catch {
- struct AutomakeReporter : StreamingReporterBase<AutomakeReporter> {
- AutomakeReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config )
- {}
- ~AutomakeReporter() override;
- static std::string getDescription() {
- return "Reports test results in the format of Automake .trs files";
- }
- void assertionStarting( AssertionInfo const& ) override {}
- bool assertionEnded( AssertionStats const& ) override { return true; }
- void testCaseEnded( TestCaseStats const& _testCaseStats ) override {
-
- stream << ":test-result: ";
- if (_testCaseStats.totals.assertions.allPassed()) {
- stream << "PASS";
- } else if (_testCaseStats.totals.assertions.allOk()) {
- stream << "XFAIL";
- } else {
- stream << "FAIL";
- }
- stream << ' ' << _testCaseStats.testInfo.name << '\n';
- StreamingReporterBase::testCaseEnded( _testCaseStats );
- }
- void skipTest( TestCaseInfo const& testInfo ) override {
- stream << ":test-result: SKIP " << testInfo.name << '\n';
- }
- };
- #ifdef CATCH_IMPL
- AutomakeReporter::~AutomakeReporter() {}
- #endif
- CATCH_REGISTER_REPORTER( "automake", AutomakeReporter)
- }
- #endif
|