[Intel-gfx] [PATCH i-g-t 9/9] tests/kms_psr_sink_crc: Use pressed key to pass/fail.

Rodrigo Vivi rodrigo.vivi at intel.com
Tue Dec 9 18:01:57 PST 2014


This is useful when 1 person is running all tests and other one is reading log willing
to know what tests passed and which failed. So tester is able to run all tests without
stop and send log to developer.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 tests/kms_psr_sink_crc.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 8103ebb..305b52d 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -301,12 +301,17 @@ static bool is_green(char *crc)
 
 static void assert_or_manual(bool condition, const char *expected)
 {
-	if (igt_interactive_debug)
-		igt_info("Is %s?\n", expected);
-	else
-		igt_debug("%s\n", expected);
-	igt_debug_wait_for_keypress("manual",
-				    "Press any key to continue ...\n");
+	char msg[50];
+	char c;
+
+	igt_debug("%s\n", expected);
+
+	sprintf(msg, "Is %s [Y/n]?\n", expected);
+	c = igt_debug_wait_for_keypress("manual", msg);
+
+	if (c && (c == 'n' || c == 'N'))
+		igt_fail(-1);
+
 	igt_assert(igt_interactive_debug || condition);
 }
 
-- 
1.9.3



More information about the Intel-gfx mailing list