Attention is currently required from: Anastasia Klimchuk.
Evan Benn has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/69264 )
Change subject: tests: Change LOG_ME to print to stderr ......................................................................
tests: Change LOG_ME to print to stderr
Printing to stderr instead of stdout helps when the test is segfaulting. stdout messages may be discarded.
BUG=b:187647884 BRANCH=None TEST=meson test
Change-Id: I1964832f62b2e13fafa0ea0537a3da499f0f4a5d Signed-off-by: Evan Benn evanbenn@chromium.org --- M tests/include/test.h M tests/wraps.h 2 files changed, 20 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/64/69264/1
diff --git a/tests/include/test.h b/tests/include/test.h index 88ac16d..e14d906 100644 --- a/tests/include/test.h +++ b/tests/include/test.h @@ -26,6 +26,7 @@ #include <stddef.h> #include <setjmp.h> #include <cmocka.h> +#include <wraps.h>
#define NON_ZERO (0xf000baaa)
@@ -37,6 +38,6 @@ */ void *not_null(void);
-#define LOG_ME printf("%s is called\n", __func__) +#define LOG_ME __real_fprintf(stderr, "%s is called\n", __func__)
#endif /* _TESTS_TEST_H */ diff --git a/tests/wraps.h b/tests/wraps.h index e2134fd..59cd6ff 100644 --- a/tests/wraps.h +++ b/tests/wraps.h @@ -54,6 +54,7 @@ int __wrap_fsync(int fd); int __wrap_setvbuf(FILE *fp, char *buf, int type, size_t size); int __wrap_fprintf(FILE *fp, const char *fmt, ...); +int __real_fprintf(FILE *fp, const char *fmt, ...); int __wrap___vfprintf_chk(FILE *fp, const char *fmt, va_list args); int __wrap_fclose(FILE *fp); int __wrap_feof(FILE *fp);