From 819c27507466a0dcd836d7deebe0775b8f3f5e96 Mon Sep 17 00:00:00 2001 From: Evan Benn Date: Fri, 4 Nov 2022 17:00:40 +1100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/flashrom/+/69267 Reviewed-by: Anastasia Klimchuk Tested-by: build bot (Jenkins) --- tests/wraps.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/wraps.h') diff --git a/tests/wraps.h b/tests/wraps.h index 92b0c42c..6cc95677 100644 --- a/tests/wraps.h +++ b/tests/wraps.h @@ -36,6 +36,7 @@ int __wrap_ioctl(int fd, unsigned long int request, ...); int __wrap_write(int fd, const void *buf, size_t sz); int __wrap_read(int fd, void *buf, size_t sz); FILE *__wrap_fopen(const char *pathname, const char *mode); +FILE *__real_fopen(const char *pathname, const char *mode); FILE *__wrap_fopen64(const char *pathname, const char *mode); FILE *__wrap_fdopen(int fd, const char *mode); FILE *__real_fdopen(int fd, const char *mode); @@ -59,6 +60,7 @@ int __wrap_setvbuf(FILE *fp, char *buf, int type, size_t size); int __wrap_fprintf(FILE *fp, const char *fmt, ...); int __wrap___vfprintf_chk(FILE *fp, const char *fmt, va_list args); int __wrap_fclose(FILE *fp); +int __real_fclose(FILE *fp); int __wrap_feof(FILE *fp); int __wrap_ferror(FILE *fp); void __wrap_clearerr(FILE *fp); -- cgit v1.2.3