All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jose.souza@intel.com, daniel@ffwll.ch, Jeevan B <jeevan.b@intel.com>
Subject: [igt-dev] [PATCH i-g-t 1/2] lib/igt_aux: Rename igt_debug_manual_check and assert check if all is supplied
Date: Wed, 25 Aug 2021 22:40:17 +0530	[thread overview]
Message-ID: <20210825171018.10821-2-jeevan.b@intel.com> (raw)
In-Reply-To: <20210825171018.10821-1-jeevan.b@intel.com>

rename igt_debug_manual_check and patch the igt functions
igt_debug_manual_check() and igt_debug_wait_for_keypress()
to assert if "all" is supplied.

Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
 lib/igt_aux.c       | 16 +++++++++++-----
 lib/igt_aux.h       |  2 +-
 tests/kms_dsc.c     |  2 +-
 tests/kms_psr.c     |  2 +-
 tests/kms_psr2_sf.c |  2 +-
 5 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 1217f5e8..4fe29c8e 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -971,8 +971,7 @@ void igt_drop_root(void)
  *
  * Waits for a key press when run interactively and when the corresponding debug
  * var is set in the --interactive-debug=$var variable. Multiple keys
- * can be specified as a comma-separated list or alternatively "all" if a wait
- * should happen for all cases.
+ * can be specified as a comma-separated list and assert if "all" is supplied.
  *
  * When not connected to a terminal interactive_debug is ignored
  * and execution immediately continues.
@@ -993,6 +992,10 @@ void igt_debug_wait_for_keypress(const char *var)
 	if (!igt_interactive_debug)
 		return;
 
+	if (strstr(igt_interactive_debug, var) &&
+	    strstr(igt_interactive_debug, "all"))
+		igt_assert(false);
+
 	if (!strstr(igt_interactive_debug, var) &&
 	    !strstr(igt_interactive_debug, "all"))
 		return;
@@ -1014,8 +1017,7 @@ void igt_debug_wait_for_keypress(const char *var)
  *
  * Waits for a key press when run interactively and when the corresponding debug
  * var is set in the --interactive-debug=$var variable. Multiple vars
- * can be specified as a comma-separated list or alternatively "all" if a wait
- * should happen for all cases.
+ * can be specified as a comma-separated list and assert if "all" is supplied.
  *
  * This is useful for display tests where under certain situation manual
  * inspection of the display is useful. Or when running a testcase in the
@@ -1028,7 +1030,7 @@ void igt_debug_wait_for_keypress(const char *var)
  *
  * Force test fail when N/n is pressed.
  */
-void igt_debug_manual_check(const char *var, const char *expected)
+void igt_debug_interactive_mode_check(const char *var, const char *expected)
 {
 	struct termios oldt, newt;
 	char key;
@@ -1041,6 +1043,10 @@ void igt_debug_manual_check(const char *var, const char *expected)
 	if (!igt_interactive_debug)
 		return;
 
+	if (strstr(igt_interactive_debug, var) &&
+	    strstr(igt_interactive_debug, "all"))
+		igt_assert(false);
+
 	if (!strstr(igt_interactive_debug, var) &&
 	    !strstr(igt_interactive_debug, "all"))
 		return;
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index bf57ccf5..a92eb799 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -193,7 +193,7 @@ int igt_get_autoresume_delay(enum igt_suspend_state state);
 void igt_drop_root(void);
 
 void igt_debug_wait_for_keypress(const char *var);
-void igt_debug_manual_check(const char *var, const char *expected);
+void igt_debug_interactive_mode_check(const char *var, const char *expected);
 
 /* sysinfo cross-arch wrappers from intel_os.c */
 
diff --git a/tests/kms_dsc.c b/tests/kms_dsc.c
index b56e0183..c5596318 100644
--- a/tests/kms_dsc.c
+++ b/tests/kms_dsc.c
@@ -72,7 +72,7 @@ int force_dsc_restore_fd = -1;
 
 static inline void manual(const char *expected)
 {
-	igt_debug_manual_check("all", expected);
+	igt_debug_interactive_mode_check("all", expected);
 }
 
 static void force_dsc_enable(data_t *data)
diff --git a/tests/kms_psr.c b/tests/kms_psr.c
index 8f2fbb8a..4ff8c001 100644
--- a/tests/kms_psr.c
+++ b/tests/kms_psr.c
@@ -246,7 +246,7 @@ static bool psr_enable_if_enabled(data_t *data)
 
 static inline void manual(const char *expected)
 {
-	igt_debug_manual_check("all", expected);
+	igt_debug_interactive_mode_check("all", expected);
 }
 
 static bool drrs_disabled(data_t *data)
diff --git a/tests/kms_psr2_sf.c b/tests/kms_psr2_sf.c
index 1be8c3da..93347327 100644
--- a/tests/kms_psr2_sf.c
+++ b/tests/kms_psr2_sf.c
@@ -331,7 +331,7 @@ static void prepare(data_t *data)
 
 static inline void manual(const char *expected)
 {
-	igt_debug_manual_check("all", expected);
+	igt_debug_interactive_mode_check("all", expected);
 }
 
 static void plane_update_expected_output(int plane_type, int box_count)
-- 
2.19.1

  reply	other threads:[~2021-08-25 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 17:10 [igt-dev] [PATCH i-g-t 0/2] Fix kms_psr2_sf test Jeevan B
2021-08-25 17:10 ` Jeevan B [this message]
2021-08-25 17:10 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_psr2_sf: Make this a generic test and change testcase design Jeevan B
2021-08-25 17:47 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix kms_psr2_sf test Patchwork
2021-08-25 22:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210825171018.10821-2-jeevan.b@intel.com \
    --to=jeevan.b@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.