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

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft/Runner/Options.cpp
diff options
context:
space:
mode:
authorLeitwolf112026-11-01 14:23:09 +0300
committerLeitwolf112026-11-01 14:23:09 +0300
commit1db203d56b7c71db3d80b477da1ad49e9ae46468 (patch)
tree48cd538e23e40ebdaae034a864082de30f68364f /src/Progmasoft/Runner/Options.cpp
parent1559307a6ac7731ffd6a8e28147552b3987dbd93 (diff)
downloadcatch3-1db203d56b7c71db3d80b477da1ad49e9ae46468.tar.gz
Import the results of other test frameworks
Tests Catch3 does not run had no history, flaky detection or quarantine. --import=FILE reads a report instead of running tests and sends it through the analysis, history and reports of a run: JUnit with Surefire's reruns, xUnit.net v2, TRX, TAP 12 to 14, CTRF, Catch3's own --json report and catch3-results, a small JSON Lines format for tools with none of these. Results that share an identifier are attempts at one test, so a report of a rerun gives a flaky test. --import-revision says what was tested: a verdict that changes on one revision also counts as flaky. --import-name keeps the results in a history of their own, which --analytics reads too. A TAP stream that ends early fails instead of reading as a run that passed. The amalgamation script now accepts a relative include of the third-party wrappers, because pugixml is included from a second directory.
Diffstat (limited to 'src/Progmasoft/Runner/Options.cpp')
-rw-r--r--src/Progmasoft/Runner/Options.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/Progmasoft/Runner/Options.cpp b/src/Progmasoft/Runner/Options.cpp
index c59d7e40..4ae99eb3 100644
--- a/src/Progmasoft/Runner/Options.cpp
+++ b/src/Progmasoft/Runner/Options.cpp
@@ -683,6 +683,58 @@ namespace Progmasoft::Catch3::Runner
options.replayFailures = true;
return Status::Ok();
}},
+ {"import",
+ '\0',
+ Takes::kValue,
+ "FILE",
+ "Importing results",
+ "read a report of another framework instead of running tests "
+ "(repeatable)",
+ [](Options &options, const std::optional<std::string> &value) {
+ options.mode = Mode::kImport;
+ options.importFiles.push_back(*value);
+ return Status::Ok();
+ }},
+ {"import-format",
+ '\0',
+ Takes::kValue,
+ "FORMAT",
+ "Importing results",
+ "auto (default), catch3, junit, xunit, trx, tap or ctrf",
+ [](Options &options, const std::optional<std::string> &value) {
+ return ReadChoice<ImportFormat>(
+ value,
+ "import-format",
+ {{"auto", ImportFormat::kAuto},
+ {"catch3", ImportFormat::kCatch3},
+ {"junit", ImportFormat::kJUnit},
+ {"xunit", ImportFormat::kXUnit},
+ {"trx", ImportFormat::kTrx},
+ {"tap", ImportFormat::kTap},
+ {"ctrf", ImportFormat::kCtrf}},
+ options.importFormat);
+ }},
+ {"import-name",
+ '\0',
+ Takes::kValue,
+ "NAME",
+ "Importing results",
+ "the history imported results go to (default: imported); "
+ "--analytics reads it too",
+ [](Options &options, const std::optional<std::string> &value) {
+ options.importName = *value;
+ return Status::Ok();
+ }},
+ {"import-revision",
+ '\0',
+ Takes::kValue,
+ "REVISION",
+ "Importing results",
+ "what the reports tested (default: the Git commit here)",
+ [](Options &options, const std::optional<std::string> &value) {
+ options.importRevision = *value;
+ return Status::Ok();
+ }},
{"analytics",
'\0',
Takes::kOptionalValue,