diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-01-18 14:49:52 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-01-18 14:49:52 +0100 |
commit | d97848118db5784ed40669ed98716a5709ed31d1 (patch) | |
tree | 911227937bed550d03bdd70bb36bade1bb328586 | |
parent | 3d1283c25172417c4b3738c987866af176e8964b (diff) |
lib/core: report subtests that hit an igt_warning as WARNINGstuff
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 <daniel.vetter@ffwll.ch>
-rw-r--r-- | lib/igt_core.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |