Coverage reports
The four report formats poly-crap reads and the command that produces one for each stack.
Poly-crap reads the report your test runner writes; it never runs tests itself. It reads four formats and detects each from its contents:
- LCOV, from
cargo llvm-cov, c8, Istanbul, coverage.py, and most others. - Cobertura XML, from
coverage xml, pytest-cov, Jest’scoberturareporter, and .NET coverlet. - JaCoCo XML, from the Maven and Gradle plug-ins.
- Go cover profiles, from
go test -coverprofile.
LCOV, Cobertura, and JaCoCo give line coverage. Go profiles give statement coverage, weighted by statement count. JSON output records which basis each function used.
Producing a report
cargo llvm-cov --lcov --output-path coverage.lcovWith c8:
npx c8 --reporter=lcov npm testEither output format works:
coverage run -m pytest
coverage lcov -o coverage.lcovpytest --cov --cov-report=xmlgo test -coverprofile=coverage.out ./...With Maven:
mvn verifyWith Gradle:
gradle test jacocoTestReportEvery one of these writes to a location poly-crap searches on its own.