Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft/Catch3/Results.hpp
diff options
context:
space:
mode:
authorLeitwolf112026-09-24 23:05:47 +0300
committerLeitwolf112026-09-24 23:05:47 +0300
commitd79b294903e4d0f4b24fdf1cc50be4b0fec7f745 (patch)
tree64f0c7c3dfbc08bfb70d9a37df5cccae3d52b526 /src/Progmasoft/Catch3/Results.hpp
parent9ad804cedf4cc4a85ef89fe097f97a3b44654360 (diff)
downloadcatch3-0.2.0.tar.gz
Add snapshots and JUnit result serialization0.2.0
Diffstat (limited to 'src/Progmasoft/Catch3/Results.hpp')
-rw-r--r--src/Progmasoft/Catch3/Results.hpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/Progmasoft/Catch3/Results.hpp b/src/Progmasoft/Catch3/Results.hpp
new file mode 100644
index 00000000..b0b69b55
--- /dev/null
+++ b/src/Progmasoft/Catch3/Results.hpp
@@ -0,0 +1,57 @@
+// Copyright (c) 2026 Progmasoft.
+// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
+#pragma once
+
+#include <cstddef>
+#include <string>
+#include <vector>
+
+namespace Progmasoft::Catch3 {
+
+ enum class TestCaseStatus : unsigned char {
+ kPassed,
+ kFailed,
+ kErrored,
+ kSkipped,
+ };
+
+ /// Framework-neutral result for one completed test case.
+ struct TestCaseResult final {
+ std::string Name;
+ std::string ClassName;
+ std::string SourceFile;
+ TestCaseStatus Status = TestCaseStatus::kPassed;
+ double DurationSeconds = 0.0;
+ std::string Message;
+ std::string Details;
+ std::string StandardOutput;
+ std::string StandardError;
+ };
+
+ struct TestSuiteResult final {
+ std::string Name;
+ std::vector<TestCaseResult> TestCases;
+ };
+
+ struct TestRunResult final {
+ std::string Name;
+ std::vector<TestSuiteResult> TestSuites;
+ };
+
+ struct TestRunSummary final {
+ std::size_t Tests = 0;
+ std::size_t Failures = 0;
+ std::size_t Errors = 0;
+ std::size_t Skipped = 0;
+ double DurationSeconds = 0.0;
+
+ [[nodiscard]] std::size_t Passed() const noexcept;
+ };
+
+ /// Validates durations and statuses while aggregating nested test results.
+ [[nodiscard]] TestRunSummary
+ SummarizeTestSuite( const TestSuiteResult& result );
+ [[nodiscard]] TestRunSummary
+ SummarizeTestRun( const TestRunResult& result );
+
+} // namespace Progmasoft::Catch3