aboutsummaryrefslogtreecommitdiffstats
path: root/src/catch2/reporters/catch_reporter_console.hpp
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-29 19:25:29 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-29 19:25:29 +0100
commitbc524d70253a4ab2fe40c3ca3e5666e267c0a4d1 (patch)
tree1e629e7b46b1d9972a973bc93fd100bcebd395be /src/catch2/reporters/catch_reporter_console.hpp
downloadnihil-vendor/catch2.tar.gz
nihil-vendor/catch2.tar.bz2
Diffstat (limited to 'src/catch2/reporters/catch_reporter_console.hpp')
-rw-r--r--src/catch2/reporters/catch_reporter_console.hpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/catch2/reporters/catch_reporter_console.hpp b/src/catch2/reporters/catch_reporter_console.hpp
new file mode 100644
index 0000000..2437726
--- /dev/null
+++ b/src/catch2/reporters/catch_reporter_console.hpp
@@ -0,0 +1,67 @@
+
+// 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_CONSOLE_HPP_INCLUDED
+#define CATCH_REPORTER_CONSOLE_HPP_INCLUDED
+
+#include <catch2/reporters/catch_reporter_streaming_base.hpp>
+#include <catch2/internal/catch_unique_ptr.hpp>
+
+namespace Catch {
+ // Fwd decls
+ class TablePrinter;
+
+ class ConsoleReporter final : public StreamingReporterBase {
+ Detail::unique_ptr<TablePrinter> m_tablePrinter;
+
+ public:
+ ConsoleReporter(ReporterConfig&& config);
+ ~ConsoleReporter() override;
+ static std::string getDescription();
+
+ void noMatchingTestCases( StringRef unmatchedSpec ) override;
+ void reportInvalidTestSpec( StringRef arg ) override;
+
+ void assertionStarting(AssertionInfo const&) override;
+
+ void assertionEnded(AssertionStats const& _assertionStats) override;
+
+ void sectionStarting(SectionInfo const& _sectionInfo) override;
+ void sectionEnded(SectionStats const& _sectionStats) override;
+
+ void benchmarkPreparing( StringRef name ) override;
+ void benchmarkStarting(BenchmarkInfo const& info) override;
+ void benchmarkEnded(BenchmarkStats<> const& stats) override;
+ void benchmarkFailed( StringRef error ) override;
+
+ void testCaseEnded(TestCaseStats const& _testCaseStats) override;
+ void testRunEnded(TestRunStats const& _testRunStats) override;
+ void testRunStarting(TestRunInfo const& _testRunInfo) override;
+
+ private:
+ void lazyPrint();
+
+ void lazyPrintWithoutClosingBenchmarkTable();
+ void lazyPrintRunInfo();
+ void printTestCaseAndSectionHeader();
+
+ void printClosedHeader(std::string const& _name);
+ void printOpenHeader(std::string const& _name);
+
+ // if string has a : in first line will set indent to follow it on
+ // subsequent lines
+ void printHeaderString(std::string const& _string, std::size_t indent = 0);
+
+ void printTotalsDivider(Totals const& totals);
+
+ bool m_headerPrinted = false;
+ bool m_testRunInfoPrinted = false;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_CONSOLE_HPP_INCLUDED