summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-08-24 12:21:14 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-24 20:46:07 +0000
commita0063be2d90ca3a8e02de1c087ef76cea928ec7f (patch)
treeb4677e51d5819c8c3c3bfde2f4c50282fe8114c6
parenta9cbf4e19e1a534be8f4b0cbe0d09d94cbe570d3 (diff)
downloadchrome-ec-a0063be2d90ca3a8e02de1c087ef76cea928ec7f.tar.gz
cq: Save the html report for herobrine coverage
In addition to the all boards html coverage report, also include the herobrine html in the build artifacts. BRANCH=None BUG=None TEST=Did build, looked in artifacts dir Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ida81797963cb1db700f7de5b4fb43acdcca490a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3854555 Reviewed-by: Yuval Peress <peress@google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org>
-rwxr-xr-xzephyr/firmware_builder.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py
index 54f880d2ed..6437ff973d 100755
--- a/zephyr/firmware_builder.py
+++ b/zephyr/firmware_builder.py
@@ -175,7 +175,10 @@ def bundle_coverage(opts):
firmware_pb2.FirmwareArtifactInfo.LcovTarballInfo.LcovType.LCOV
)
(bundle_dir / "html").mkdir(exist_ok=True)
- cmd = ["mv", "lcov_rpt", bundle_dir / "html/lcov_rpt"]
+ cmd = ["mv", "lcov_rpt"]
+ for board in SPECIAL_BOARDS:
+ cmd.append(board + "_rpt")
+ cmd.append(bundle_dir / "html/")
print(" ".join(shlex.quote(str(x)) for x in cmd))
subprocess.run(cmd, cwd=build_dir, check=True, stdin=subprocess.DEVNULL)
meta = info.objects.add()
@@ -486,6 +489,22 @@ def test(opts):
stdin=subprocess.DEVNULL,
).stdout
_extract_lcov_summary(f"BOARD_{board}".upper(), metrics, output)
+ subprocess.run(
+ [
+ "/usr/bin/genhtml",
+ "--branch-coverage",
+ "-q",
+ "-o",
+ build_dir / (board + "_rpt"),
+ "-t",
+ f"{board} ec code only",
+ "-s",
+ build_dir / (board + "_final.info"),
+ ],
+ cwd=zephyr_dir,
+ check=True,
+ stdin=subprocess.DEVNULL,
+ )
with open(opts.metrics, "w") as file:
file.write(json_format.MessageToJson(metrics)) # type: ignore