mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Add a `--coverage` flag to `./mach build` and a `./mach coverage-report` command to use `cargo llvm-cov` to generate a coverage report from the raw profiles. The workflow is: ``` ./mach build --coverage [--profile <cargo_profile>] # Or test-wpt or test-devtools ./mach run --coverage [--profile <cargo_profile>] # Note, that coverage-report needs to know the cargo build profile. ./mach coverage-report [--profile <cargo_profile>] [optional parameters for cargo-llvm-cov] ``` According to the LLVM documentation on source based coverage, the optimization profile should not influence the accuracy of the coverage profile, so we can gather coverage data from optimized builds. Note that `./mach test-devtools --coverage` will not produce any coverage profiles yet, since the test runner kills the servo binary, which prevents writing the profile data at shutdown. The same problem also affects `test-wpt` with `servodriver`, which will be fixed by https://github.com/servo/servo/pull/40455. Testing: Manually tested. A CI workflow to test wpt coverage will be added in a follow-up PR. --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
1.1 KiB
Executable File
1.1 KiB
Executable File