From d97848118db5784ed40669ed98716a5709ed31d1 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 18 Jan 2018 14:49:52 +0100 Subject: lib/core: report subtests that hit an igt_warning as WARNING This is another piece of prep work to push the detection of dmesg warnings into igt itself, so that we can correctly report dmesg issue on a per-subtest basis even when running the entire binary. Signed-off-by: Daniel Vetter --- lib/igt_core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 65b39458..d61d3229 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1021,6 +1021,7 @@ void __igt_subtest_group_restore(int save) static bool skipped_one = false; static bool succeeded_one = false; static bool failed_one = false; +static bool warned = false; static void exit_subtest(const char *) __attribute__((noreturn)); static void exit_subtest(const char *result) @@ -1037,6 +1038,7 @@ static void exit_subtest(const char *result) igt_terminate_spin_batches(); in_subtest = NULL; + warned = false; siglongjmp(igt_subtest_jmpbuf, 1); } @@ -1126,7 +1128,7 @@ void igt_success(void) { succeeded_one = true; if (in_subtest) - exit_subtest("SUCCESS"); + exit_subtest(warned ? "WARNING" : "SUCCESS"); } /** @@ -2120,6 +2122,9 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, if (list_subtests && level <= IGT_LOG_WARN) return; + if (level >= IGT_LOG_WARN) + warned = true; + if (vasprintf(&line, format, args) == -1) return; -- cgit v1.2.3