From bc524d70253a4ab2fe40c3ca3e5666e267c0a4d1 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Sun, 29 Jun 2025 19:25:29 +0100 Subject: import catch2 3.8.1 --- src/catch2/reporters/catch_reporter_tap.hpp | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/catch2/reporters/catch_reporter_tap.hpp (limited to 'src/catch2/reporters/catch_reporter_tap.hpp') diff --git a/src/catch2/reporters/catch_reporter_tap.hpp b/src/catch2/reporters/catch_reporter_tap.hpp new file mode 100644 index 0000000..e6889bb --- /dev/null +++ b/src/catch2/reporters/catch_reporter_tap.hpp @@ -0,0 +1,42 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_REPORTER_TAP_HPP_INCLUDED +#define CATCH_REPORTER_TAP_HPP_INCLUDED + +#include +#include + +namespace Catch { + + class TAPReporter final : public StreamingReporterBase { + public: + TAPReporter( ReporterConfig&& config ): + StreamingReporterBase( CATCH_MOVE(config) ) { + m_preferences.shouldReportAllAssertions = true; + } + + static std::string getDescription() { + using namespace std::string_literals; + return "Reports test results in TAP format, suitable for test harnesses"s; + } + + void testRunStarting( TestRunInfo const& testInfo ) override; + + void noMatchingTestCases( StringRef unmatchedSpec ) override; + + void assertionEnded(AssertionStats const& _assertionStats) override; + + void testRunEnded(TestRunStats const& _testRunStats) override; + + private: + std::size_t counter = 0; + }; + +} // end namespace Catch + +#endif // CATCH_REPORTER_TAP_HPP_INCLUDED -- cgit v1.2.3