From a0063be2d90ca3a8e02de1c087ef76cea928ec7f Mon Sep 17 00:00:00 2001 From: Jeremy Bettis Date: Wed, 24 Aug 2022 12:21:14 -0600 Subject: 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 Change-Id: Ida81797963cb1db700f7de5b4fb43acdcca490a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3854555 Reviewed-by: Yuval Peress Auto-Submit: Jeremy Bettis Commit-Queue: Yuval Peress Tested-by: Jeremy Bettis --- zephyr/firmware_builder.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1