[igt-dev] [CI 5/6] lib/core: report subtests that hit an igt_warning as WARNING

Petri Latvala petri.latvala at intel.com
Fri Mar 2 10:55:12 UTC 2018


From: Daniel Vetter <daniel.vetter at ffwll.ch>

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 at ffwll.ch>
---
 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 d756f9c1..0b3bf49e 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1059,6 +1059,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)
@@ -1075,6 +1076,7 @@ static void exit_subtest(const char *result)
 	igt_terminate_spin_batches();
 
 	in_subtest = NULL;
+	warned = false;
 	siglongjmp(igt_subtest_jmpbuf, 1);
 }
 
@@ -1164,7 +1166,7 @@ void igt_success(void)
 {
 	succeeded_one = true;
 	if (in_subtest)
-		exit_subtest("SUCCESS");
+		exit_subtest(warned ? "WARNING" : "SUCCESS");
 }
 
 /**
@@ -2158,6 +2160,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;
 
-- 
2.14.1



More information about the igt-dev mailing list