diff options
| author | Leitwolf11 | 2026-11-01 14:48:55 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-11-01 14:48:55 +0300 |
| commit | 569620dad14df7e13bb9fd31d256e9fd873ef6ec (patch) | |
| tree | f933300c29658c3eb89d126d74b6c30fdff9dd04 /src/Progmasoft/Runner/ResultImport.cpp | |
| parent | 1db203d56b7c71db3d80b477da1ad49e9ae46468 (diff) | |
| download | catch3-feature/result-import.tar.gz | |
Keep real failures visible when importingfeature/result-import
A review of the import found ways for a failure to disappear or for the
import to reach too far.
- CTRF's retryAttempts ends before the final attempt, which was dropped when
its outcome matched the one before it.
- TAP names tests only within a stream, so a failure in one file and a pass
under the same name in another merged into a flaky pass. The path given to
--import is now the class of a stream's tests.
- A failure followed by a skip with the same identifier read as skipped.
- Directives are whole words: TODOING is not TODO. SKIPPED and SKIPPING stay
directives, as harnesses treat them.
- Verdicts that alternate count as flaky only under an explicit
--import-revision. HEAD says nothing about a dirty checkout or a report from
another one, and two such events could quarantine a real failure.
- --import-name no longer redirects the history of a normal test run.
- Importing does not depend on the tests registered in the binary.
Diffstat (limited to 'src/Progmasoft/Runner/ResultImport.cpp')
| -rw-r--r-- | src/Progmasoft/Runner/ResultImport.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/Progmasoft/Runner/ResultImport.cpp b/src/Progmasoft/Runner/ResultImport.cpp index 10a9c5a8..cfd9a2ba 100644 --- a/src/Progmasoft/Runner/ResultImport.cpp +++ b/src/Progmasoft/Runner/ResultImport.cpp @@ -156,7 +156,9 @@ namespace Progmasoft::Catch3::Runner } Expected<std::vector<TestResult>> - ParseImport(std::string_view text, ImportFormat format) + ParseImport(std::string_view text, + ImportFormat format, + const std::string &source) { const std::string_view contents = ImportText::Contents(text); switch (format) @@ -172,7 +174,7 @@ namespace Progmasoft::Catch3::Runner case ImportFormat::kTrx: return ParseTrx(contents); case ImportFormat::kTap: - return ParseTap(contents); + return ParseTap(contents, source); case ImportFormat::kCtrf: return ParseCtrf(contents); } @@ -182,7 +184,7 @@ namespace Progmasoft::Catch3::Runner return Error{ "its format is not one Catch3 knows; " "--import-format names it" }; } - return ParseImport(contents, *detected); + return ParseImport(contents, *detected, source); } std::vector<TestResult> @@ -224,8 +226,18 @@ namespace Progmasoft::Catch3::Runner { continue; } - test.outcome = test.attempts.back().outcome; - test.category = test.attempts.back().category; + // A report of a skip says nothing about an earlier failure. + const auto verdict + = std::find_if(test.attempts.rbegin(), + test.attempts.rend(), + [](const Attempt &attempt) { + return IsFailure(attempt.outcome); + }); + const Attempt &last = verdict != test.attempts.rend() + ? *verdict + : test.attempts.back(); + test.outcome = last.outcome; + test.category = last.category; if (passes > 0 && failures > 0) { test.outcome = Outcome::kPassed; |