Emit JUnit XML from tests + mutation, consume it in CI
Produce machine-readable results and surface them in the Gitea pipeline:
- ctest: run with --output-junit to write ctest-junit.xml. The path must be
absolute ("$(pwd)/...") because --output-junit otherwise resolves relative to
the --test-dir build directory.
- mutation_test.py: new --junit FILE option writes a JUnit report where each
mutant is a test case and a surviving mutant is a <failure> (so gaps show up
as failing tests).
- .gitea/workflows/ci.yaml: both jobs generate their XML and feed it to
mikepenz/action-junit-report with `if: always()`, so results publish even
when a gate fails. Mutation publishing is display-only (fail_on_failure:
false); the --threshold flag remains the gate.
- .gitignore: ignore the generated *-junit.xml artifacts.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,20 @@ cmake --build build --target mutation
|
||||
|
||||
Useful flags: `--timeout SECONDS` (per-suite build+test cap; a mutant that
|
||||
hangs is counted as killed), `--keep` (retain the scratch copy for debugging),
|
||||
`--work DIR` (use a specific scratch directory).
|
||||
`--work DIR` (use a specific scratch directory), `--junit FILE` (write a JUnit
|
||||
XML report — surviving mutants appear as failing test cases).
|
||||
|
||||
## CI reporting
|
||||
|
||||
Both the unit tests and the mutation run emit JUnit XML that CI consumes:
|
||||
|
||||
* `ctest --test-dir build --output-junit "$(pwd)/ctest-junit.xml"` — note the
|
||||
absolute path; `--output-junit` otherwise resolves relative to the test dir.
|
||||
* `scripts/mutation_test.py --junit mutation-junit.xml`
|
||||
|
||||
`.gitea/workflows/ci.yaml` runs both and feeds the XML to
|
||||
`mikepenz/action-junit-report` (with `if: always()`, so results publish even
|
||||
when a gate fails). The generated `*-junit.xml` files are git-ignored.
|
||||
|
||||
## Mutation operators
|
||||
|
||||
|
||||
Reference in New Issue
Block a user