mirror of
https://github.com/catchorg/Catch2.git
synced 2025-04-29 12:03:53 +00:00
The new scheme is that there is one protected member instance of `ReporterPreferences` in the `IStreamingReporter` base class, and derived classes can modify it to express their own preferences. Retrieving the preferences is now a non-virtual operation, which makes it much cheaper to read them frequently. Previously, we avoided doing so by caching the preferences in another variable, but we still read them at least once per test case run.
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
/*
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
*/
|
|
#ifndef TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
|
|
#define TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
|
|
|
|
#include <catch2/reporters/catch_reporter_bases.hpp>
|
|
|
|
namespace Catch {
|
|
|
|
struct TAPReporter : StreamingReporterBase {
|
|
|
|
TAPReporter( ReporterConfig const& config ):
|
|
StreamingReporterBase( config ) {
|
|
m_preferences.shouldReportAllAssertions = true;
|
|
}
|
|
~TAPReporter() override;
|
|
|
|
static std::string getDescription() {
|
|
using namespace std::string_literals;
|
|
return "Reports test results in TAP format, suitable for test harnesses"s;
|
|
}
|
|
|
|
void noMatchingTestCases(std::string const& spec) override;
|
|
|
|
void assertionStarting( AssertionInfo const& ) override {}
|
|
|
|
bool assertionEnded(AssertionStats const& _assertionStats) override;
|
|
|
|
void testRunEnded(TestRunStats const& _testRunStats) override;
|
|
|
|
private:
|
|
std::size_t counter = 0;
|
|
};
|
|
|
|
} // end namespace Catch
|
|
|
|
#endif // TWOBLUECUBES_CATCH_REPORTER_TAP_HPP_INCLUDED
|