Skip to content

Commit bbf5d4b

Browse files
roypatzulinx86
authored andcommitted
Ignore bindgen generated modules for codecov purposes
Modules generated by bindgen.rs do not contain any logic, but rather just define structs, constants, etc. However, bindgen does generate a lot of tests for these for example to check alignment and size. The problem here is that it does not put these into a `mod test` behind a `cfg(test)`, meaning code coverage tooling picks them up as production code. This means that all `assert!` statements are marked as partially uncovered, resulting in reported code coverage for these files (that don't even contain any logic) to be 30%. Thus, exclude these files from the coverage reports. Signed-off-by: Patrick Roy <[email protected]>
1 parent 81cacbf commit bbf5d4b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/integration_tests/build/test_coverage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def test_coverage(monkeypatch):
6363
--ignore "**/test_utils*" \
6464
--ignore "**/mock_*" \
6565
--ignore "src/firecracker/examples/*" \
66+
--ignore "**/gen*" \
6667
-t lcov \
6768
--ignore-not-existing \
6869
-o {lcov_file}"""

0 commit comments

Comments
 (0)