summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-02-24 12:09:05 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-25 01:03:33 +0000
commitfdd28a51a218d50d76caf833ec46cff61fc4a699 (patch)
tree24f7dddc44fcaa4964d1e51ead5ff3f78dd25540
parent8e85a57293d2c7517ebb0a15e2df732066816191 (diff)
downloadchrome-ec-fdd28a51a218d50d76caf833ec46cff61fc4a699.tar.gz
cq: Use relative paths in lcov.info file
After merging the lcov files, strip any platform/ec prefixes from the filenames. Gerrit's zoss plugin wants relative paths. BRANCH=None BUG=b:156895937 TEST=Ran commands in README.md Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I9eb85362e6ffc32bdc3c8e21979cf847df2dd5a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489263 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
-rwxr-xr-xzephyr/firmware_builder.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py
index 2b138357f3..912b734ae6 100755
--- a/zephyr/firmware_builder.py
+++ b/zephyr/firmware_builder.py
@@ -140,7 +140,7 @@ def test(opts):
cmd = [
"/usr/bin/lcov",
"-o",
- build_dir / "lcov.info",
+ build_dir / "fullpaths.info",
"--rc",
"lcov_branch_coverage=1",
"-a", build_dir / 'all_tests.info',
@@ -149,6 +149,20 @@ def test(opts):
rv = subprocess.run(cmd, cwd=pathlib.Path(__file__).parent).returncode
if rv != 0:
return rv
+ # Make filenames relative to platform/ec
+ cmd = ["sed", "-e", "s|^SF:.*/platform/ec/|SF:|"]
+ with open(build_dir / "fullpaths.info") as infile, open(
+ build_dir / "lcov.info", "w"
+ ) as outfile:
+ rv = subprocess.run(
+ cmd,
+ cwd=pathlib.Path(__file__).parent,
+ stdin=infile,
+ stdout=outfile,
+ ).returncode
+ if rv != 0:
+ return rv
+
return 0