summaryrefslogtreecommitdiff
path: root/zephyr/zmake/zmake/zmake.py
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/zmake/zmake/zmake.py')
-rw-r--r--zephyr/zmake/zmake/zmake.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py
index 301ee5c431..70f58ed129 100644
--- a/zephyr/zmake/zmake/zmake.py
+++ b/zephyr/zmake/zmake/zmake.py
@@ -513,7 +513,8 @@ class Zmake:
shutil.rmtree(tmpdir)
return rv
- def _run_lcov(self, build_dir, lcov_file, initial=False):
+ def _run_lcov(self, build_dir, lcov_file, initial=False, gcov=""):
+ gcov = os.path.abspath(gcov)
with self.jobserver.get_job():
if initial:
self.logger.info("Running (initial) lcov on %s.", build_dir)
@@ -522,7 +523,7 @@ class Zmake:
cmd = [
"/usr/bin/lcov",
"--gcov-tool",
- self.module_paths["ec"] / "util/llvm-gcov.sh",
+ gcov,
"-q",
"-o",
"-",
@@ -606,9 +607,11 @@ class Zmake:
procs = []
dirs = {}
+ gcov = "gcov.sh-not-found"
for build_name, build_config in build_project.iter_builds():
self.logger.info("Building %s:%s all.libraries.", build_dir, build_name)
dirs[build_name] = build_dir / "build-{}".format(build_name)
+ gcov = dirs[build_name] / "gcov.sh"
proc = self.jobserver.popen(
["/usr/bin/ninja", "-C", dirs[build_name], "all.libraries"],
# Ninja will connect as a job client instead and claim
@@ -638,7 +641,7 @@ class Zmake:
if proc.wait():
raise OSError(get_process_failure_msg(proc))
- return self._run_lcov(build_dir, lcov_file, initial=True)
+ return self._run_lcov(build_dir, lcov_file, initial=True, gcov=gcov)
def _coverage_run_test(self, project, build_dir, lcov_file):
self.logger.info("Running test %s in %s", project.project_dir, build_dir)
@@ -651,7 +654,10 @@ class Zmake:
)
if rv:
return rv
- return self._run_lcov(build_dir, lcov_file, initial=False)
+ gcov = "gcov.sh-not-found"
+ for build_name, build_config in project.iter_builds():
+ gcov = build_dir / "build-{}".format(build_name) / "gcov.sh"
+ return self._run_lcov(build_dir, lcov_file, initial=False, gcov=gcov)
def coverage(self, build_dir):
"""Builds all targets with coverage enabled, and then runs the tests."""