-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Strange coverage results from -C instrument-coverage #102477
Copy link
Copy link
Closed as not planned
Labels
A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)Area: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.Category: This is a bug.S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.Status: This issue has no reproduction and needs a reproduction to make progress.
Metadata
Metadata
Assignees
Labels
A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)Area: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.Category: This is a bug.S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.Status: This issue has no reproduction and needs a reproduction to make progress.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I do not know in what part the problem begins, so if rustc has nothing to do with it, please tell me how to check that. I'm a maintainer of quick-xml and I setup a coverage for it and collect coverage, using
RUSTFLAGS: -C instrument-coverage.However, results on codecov.io looks very strange:
uses ormoddeclarations marked as not covered (in the same place)#[cfg(test)]modules) are also included in coverage which is unexpected, for example: https://app.codecov.io/gh/tafia/quick-xml/blob/master/src/de/mod.rs. That code should be used to produce coverage, not for coverage. This seriously biases the results, especially when you have more lines with tests than with code itself.Meta
The coverage is collected by GitHub
ubuntu-latestrunner, currently it reports Rust 1.64.0, but the issue was there since coverage was added to quick-xml, i.e. at least since 2022-05-30. The corresponding GitHub Actions file: https://github.com/tafia/quick-xml/blob/240f2049aec50876b6e13e632120b20cd60a37af/.github/workflows/rust.yml