Lines Matching +full:continue +full:- +full:on +full:- +full:error

3 # Copyright (c) 2018-2025 Intel Corporation
4 # SPDX-License-Identifier: Apache-2.0
46 logger.error(f"Unsupported coverage tool specified: {tool}")
54 logger.debug(f"Working on {input_file}")
63 continue
69 continue
76 hex_dump = sp[1][:-1]
78 continue
80 continue
104 # Iteratively call gcov-tool (not gcov) to merge the files
105 merge_tool = self.gcov_tool + '-tool'
106 for d1, d2 in zip(dirs[:-1], dirs[1:], strict=False):
107 cmd = [merge_tool, 'merge', d1, d2, '--output', d2]
111 with open(f'{dirs[-1]}/tmp.gcda', 'rb') as fp:
112 return fp.read(-1).hex()
121 filename = (filename[:-4]) + "gcno"
124 continue
150 logger.error(f"Gcov data invalid for: {filename}")
153 logger.error(f"Gcov data capture incomplete: {filename}")
212 ['lcov', '--version'],
220 logger.error(f"Unable to determine lcov version: {e}")
223 logger.error(f"Unable to find lcov tool: {e}")
241 # The --ignore-errors source option is added for genhtml as well as
245 "--ignore-errors", "inconsistent,inconsistent",
246 "--ignore-errors", "negative,negative",
247 "--ignore-errors", "unused,unused",
248 "--ignore-errors", "empty,empty",
249 "--ignore-errors", "mismatch,mismatch",
260 # Default: --parallel=0 will autodetect appropriate parallelism
261 parallel = ["--parallel", "0"]
266 parallel = ["--parallel", str(self.jobs)]
272 "lcov", "--gcov-tool", self.gcov_tool,
273 "--rc", branch_coverage,
291 continue
294 cmd = ["--output-file", coveragefile]
296 cmd.append("--add-tracefile")
299 cmd = ["--capture", "--directory", outdir, "--output-file", coveragefile]
301 invalid_chars = re.compile(r"[^A-Za-z0-9_]")
302 cmd.append("--test-name")
306 logger.error("LCOV capture report stage failed with %s", ret)
310 cmd = ["--extract", coveragefile,
312 "--output-file", ztestfile]
315 logger.error("LCOV extract report stage failed with %s", ret)
320 cmd = ["--remove", ztestfile,
322 "--output-file", ztestfile]
325 logger.error("LCOV remove ztest report stage failed with %s", ret)
333 cmd = ["--remove", coveragefile, i, "--output-file", coveragefile]
336 logger.error("LCOV remove ignores report stage failed with %s", ret)
342 cmd = ["genhtml", "--legend", "--branch-coverage",
343 "--prefix", self.base_dir,
344 "-output-directory", os.path.join(outdir, "coverage")]
346 cmd.append("--show-details")
350 logger.error("LCOV genhtml report stage failed with %s", ret)
364 # Different ifdef-ed implementations of the same function should not be
366 self.options = ["-v", "--merge-mode-functions=separate"]
372 ['gcovr', '--version'],
382 logger.error(f"Unable to determine gcovr version: {e}")
385 logger.error(f"Unable to find gcovr tool: {e}")
407 excludes = Gcovr._interleave_list("-e", self.ignores)
411 excludes += ["--exclude-branches-by-pattern", merged_regex]
414 cmd = ["gcovr", "-r", self.base_dir,
415 "--gcov-ignore-parse-errors=negative_hits.warn_once_per_file",
416 "--gcov-executable", self.gcov_tool,
417 "-e", "tests/*"]
418 cmd += excludes + self.options + ["--json", "-o", coverage_file, outdir]
425 logger.error(f"GCOVR failed with {ret}")
428 cmd = ["gcovr", "-r", self.base_dir] + self.options
429 cmd += ["--gcov-executable", self.gcov_tool,
430 "-f", "tests/ztest", "-e", "tests/ztest/test/*",
431 "--json", "-o", ztest_file, outdir]
438 logger.error(f"GCOVR ztest stage failed with {ret}")
461 continue
465 cmd_ = ["--json-pretty", "--json", coverage_file]
477 tracefiles = self._interleave_list("--add-tracefile", files)
479 # Convert command line argument (comma-separated list) to gcovr flags
481 "html": ["--html", os.path.join(subdir, "index.html"), "--html-details"],
482 "xml": ["--xml", os.path.join(subdir, "coverage.xml"), "--xml-pretty"],
483 "csv": ["--csv", os.path.join(subdir, "coverage.csv")],
484 "txt": ["--txt", os.path.join(subdir, "coverage.txt")],
485 "coveralls": ["--coveralls", os.path.join(subdir, "coverage.coveralls.json"),
486 "--coveralls-pretty"],
487 "sonarqube": ["--sonarqube", os.path.join(subdir, "coverage.sonarqube.xml")]
493 cmd = ["gcovr", "-r", self.base_dir] + self.options + gcovr_options + tracefiles
495 cmd += ["--json-summary-pretty", "--json-summary", coverage_summary]
502 logger.error(f"GCOVR merge report stage failed with {ret}")
512 "x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gcov")
517 llvm_cov = shutil.which("llvm-cov", path=llvm_path)
530 logger.error(
531 "Can't find a suitable gcov tool. Use --gcov-tool or set ZEPHYR_SDK_INSTALL_DIR."
560 # Ignore branch coverage on LOG_* and LOG_HEXDUMP_* macros
563 # Ignore branch coverage on __ASSERT* macros
590 """ Per-instance code coverage called by ProjectBuilder ('coverage' operation).