summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-07-06 13:08:40 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-07 16:01:43 +0000
commitad2968b5c65860d6c8e4808d37d6f7111ece1f6c (patch)
tree9091e7588be2f3c6c4b08bc1d40683d2a31ad01e
parenta77fc18cbd1a10f069597b73c2aa8a8c370fa303 (diff)
downloadchrome-ec-ad2968b5c65860d6c8e4808d37d6f7111ece1f6c.tar.gz
cq: Merge in the legacy tests in the zephyr cov
Just like in gitlab, merge in the legacy coverage data, and put that into the ALL_MERGED metric. BRANCH=None BUG=b:231639771 TEST=Ran locally. Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I05128b0c07160ab6d5f3937216dd1797b2403f39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3748852 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
-rwxr-xr-xzephyr/firmware_builder.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py
index 21767d635a..c8c34f02ae 100755
--- a/zephyr/firmware_builder.py
+++ b/zephyr/firmware_builder.py
@@ -193,7 +193,7 @@ def test(opts):
cmd = [
'/usr/bin/lcov',
'-o',
- build_dir / 'lcov.info',
+ build_dir / 'zephyr_merged.info',
'--rc',
'lcov_branch_coverage=1',
'-a',
@@ -212,6 +212,32 @@ def test(opts):
stdout=subprocess.PIPE, universal_newlines=True).stdout
_extract_lcov_summary('EC_ZEPHYR_TESTS', metrics, output)
+ cmd = ['make', 'coverage', f'-j{opts.cpus}']
+ print(f"# Running {' '.join(cmd)}.")
+ subprocess.run(cmd, cwd=platform_ec, check=True)
+
+ output = subprocess.run(
+ ['/usr/bin/lcov', '--summary', platform_ec / 'build/coverage/lcov.info'],
+ cwd=pathlib.Path(__file__).parent, check=True,
+ stdout=subprocess.PIPE, universal_newlines=True).stdout
+ _extract_lcov_summary('EC_LEGACY_MERGED', metrics, output)
+
+ cmd = [
+ '/usr/bin/lcov',
+ '-o',
+ build_dir / 'lcov.info',
+ '--rc',
+ 'lcov_branch_coverage=1',
+ '-a',
+ build_dir / 'zephyr_merged.info',
+ '-a',
+ platform_ec / 'build/coverage/lcov.info',
+ ]
+ output = subprocess.run(
+ cmd, cwd=pathlib.Path(__file__).parent, check=True,
+ stdout=subprocess.PIPE, universal_newlines=True).stdout
+ _extract_lcov_summary('ALL_MERGED', metrics, output)
+
with open(opts.metrics, 'w') as file:
file.write(json_format.MessageToJson(metrics))
return 0