diff options
author | Evan Benn <evanbenn@chromium.org> | 2022-11-04 17:00:40 +1100 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-12-09 00:28:36 +0000 |
commit | 819c27507466a0dcd836d7deebe0775b8f3f5e96 (patch) | |
tree | bd821da7850ef10c12eac94717cc5ca68ade747f /Documentation | |
parent | bcaaae15ae65fe8b2f0c2f9cb55c777a57eb5de4 (diff) | |
download | flashrom-819c27507466a0dcd836d7deebe0775b8f3f5e96.tar.gz flashrom-819c27507466a0dcd836d7deebe0775b8f3f5e96.tar.bz2 flashrom-819c27507466a0dcd836d7deebe0775b8f3f5e96.zip |
tests: Detect llvm coverage run and redirect to real I/O functions
Code coverage writes data to disk, we need to use real io functions at
this point so that the data is really written.
BUG=b:187647884
BRANCH=None
TEST=llvm-profdata merge -sparse default.profraw -o default.profdata
TEST=llvm-cov show ./flashrom_unit_tests
-instr-profile=default.profdata --format=html --output-dir=.
Change-Id: I21cc1d631e92fa19006b967e85676f108e80b307
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69267
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/building.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/building.md b/Documentation/building.md index 81daeb06..e25482e5 100644 --- a/Documentation/building.md +++ b/Documentation/building.md @@ -60,6 +60,17 @@ ninja -C buildcov test ninja -C buildcov coverage ``` +#### llvm +https://clang.llvm.org/docs/SourceBasedCodeCoverage.html +``` +env CFLAGS="-fprofile-instr-generate -fcoverage-mapping" CC=clang meson setup buildclangcov +env LLVM_PROFILE_FILE=default.profraw ninja -C buildclangcov test +cd buildclangcov +llvm-profdata merge -sparse default.profraw -o default.profdata +llvm-cov show ./flashrom_unit_tests -instr-profile=default.profdata --format=html --output-dir=. +open index.html +``` + ## System specific information ### Ubuntu / Debian (Linux) * __linux-headers__ are version specific |