Use -compilation-dir for llvm-cov
https://reviews.llvm.org/D100232
coverage builds now have relative paths to source code from the build
directory, so llvm-cov is failing to find the source code.
`-compilation-dir` is now available to specify the build directory
for the relative paths.
Bug: 1216203, 1204920
Change-Id: I79bfd6461c315fa9dc555c0829854e612685f122
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2950169
Reviewed-by: Yuke Liao <[email protected]>
Commit-Queue: Yuke Liao <[email protected]>
Cr-Commit-Position: refs/heads/master@{#891281}
diff --git a/tools/code_coverage/coverage.py b/tools/code_coverage/coverage.py
index 9af3f2c..a8ee502 100755
--- a/tools/code_coverage/coverage.py
+++ b/tools/code_coverage/coverage.py
@@ -232,6 +232,7 @@
subprocess_cmd = [
LLVM_COV_PATH, 'show', '-format={}'.format(output_format),
+ '-compilation-dir={}'.format(BUILD_DIR),
'-output-dir={}'.format(OUTPUT_DIR),
'-instr-profile={}'.format(profdata_file_path), binary_paths[0]
]
@@ -617,6 +618,7 @@
logging.error("Binary %s does not exist", path)
subprocess_cmd = [
LLVM_COV_PATH, 'export', '-summary-only',
+ '-compilation-dir={}'.format(BUILD_DIR),
'-instr-profile=' + profdata_file_path, binary_paths[0]
]
subprocess_cmd.extend(