diff options
| author | Leitwolf | 2026-11-14 16:46:04 +0300 |
|---|---|---|
| committer | GitHub | 2026-11-14 16:46:04 +0300 |
| commit | 94a996a3ceafa9f0004ffc28a7de5c543cdb51c2 (patch) | |
| tree | e8db06877788de36d3fd4166472c4511f0c0412a /src/Progmasoft/Runner/Options.cpp | |
| parent | 586a42e35788d269871dcadbed2ec59b6b8a9203 (diff) | |
| parent | 5ad02bccfcb925df02d1273901b6e248d477c5fa (diff) | |
| download | catch3-94a996a3ceafa9f0004ffc28a7de5c543cdb51c2.tar.gz | |
Merge pull request #39 from Progmasoft/feature/per-test-coverage
Keep per-test coverage with --coverage (roadmap step 4)
Diffstat (limited to 'src/Progmasoft/Runner/Options.cpp')
| -rw-r--r-- | src/Progmasoft/Runner/Options.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Progmasoft/Runner/Options.cpp b/src/Progmasoft/Runner/Options.cpp index 13cf4be7..aef0df6c 100644 --- a/src/Progmasoft/Runner/Options.cpp +++ b/src/Progmasoft/Runner/Options.cpp @@ -830,6 +830,21 @@ namespace Progmasoft::Catch3::Runner options.tracePath = *value; return Status::Ok(); }}, + {"coverage", + '\0', + Takes::kValue, + "DIR", + "Output", + "run every test in a process of its own and keep its " + "coverage in DIR, with a map of what each test reached", + [](Options &options, const std::optional<std::string> &value) { + if (value->empty()) + { + return Status{ Error{ "--coverage needs a directory" } }; + } + options.coverageDirectory = *value; + return Status::Ok(); + }}, {"premature-exit-guard-file", '\0', Takes::kValue, @@ -1105,6 +1120,11 @@ namespace Progmasoft::Catch3::Runner return status.GetError(); } } + if (!options.coverageDirectory.empty() && options.inProcess) + { + return Error{ "--coverage runs every test in a process of its own, " + "so it cannot be used with --in-process or --break" }; + } return options; } |