mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 14:11:15 +02:00
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>
This commit is contained in:

committed by
Anastasia Klimchuk

parent
bcaaae15ae
commit
819c275074
@ -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
|
||||
|
Reference in New Issue
Block a user