From db55425c2c783b32ce713e5de54036652a3a3b15 Mon Sep 17 00:00:00 2001 From: Jeremy Bettis Date: Tue, 19 Jul 2022 10:01:00 -0600 Subject: cq: Exclude build dir from coverage The build dir contains a number of generated files, that creates some inconsistent results in the coverage reports. Because of this, and also because those files are generated and don't matter, exclude them from the coverage report. BRANCH=None BUG=b:213374060 TEST=Ran commands in README.md Signed-off-by: Jeremy Bettis Change-Id: Ie1da42c3cc14faa917d2f0deca6c7acc9a9b7751 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3773934 Tested-by: Jeremy Bettis Reviewed-by: Keith Short Commit-Queue: Keith Short Auto-Submit: Jeremy Bettis --- zephyr/firmware_builder.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'zephyr/firmware_builder.py') diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py index 60a716d170..fb1bbac6c0 100755 --- a/zephyr/firmware_builder.py +++ b/zephyr/firmware_builder.py @@ -234,7 +234,7 @@ def test(opts): cmd = [ "/usr/bin/lcov", "-o", - build_dir / "lcov.info", + build_dir / "lcov_unfiltered.info", "--rc", "lcov_branch_coverage=1", "-a", @@ -242,6 +242,22 @@ def test(opts): "-a", platform_ec / "build/coverage/lcov.info", ] + subprocess.run( + cmd, + cwd=pathlib.Path(__file__).parent, + check=True, + ) + + cmd = [ + "/usr/bin/lcov", + "-o", + build_dir / "lcov.info", + "--rc", + "lcov_branch_coverage=1", + "-r", + build_dir / "lcov_unfiltered.info", + platform_ec / "build/**", + ] output = subprocess.run( cmd, cwd=pathlib.Path(__file__).parent, -- cgit v1.2.1