Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v4] kms_flip_event_leak: Create dynamic subtests
@ 2022-09-20  8:23 Jeevan B
  2022-09-20 11:35 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_flip_event_leak: Create dynamic subtests (rev6) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jeevan B @ 2022-09-20  8:23 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

Converting the existing subtests to dynamic subtests.

v2: Add igt_dispaly_require_output and igt_display_reset and update the
test name. (Bhanu)
v3: Rename subtest. (Petri)

Signed-off-by: Jeevan B <jeevan.b@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_flip_event_leak.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/tests/kms_flip_event_leak.c b/tests/kms_flip_event_leak.c
index ac201293..9815f1e2 100644
--- a/tests/kms_flip_event_leak.c
+++ b/tests/kms_flip_event_leak.c
@@ -48,6 +48,7 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output)
 	struct igt_fb fb[2];
 	int fd, ret;
 
+	igt_display_reset(&data->display);
 	/* select the pipe we want to use */
 	igt_output_set_pipe(output, pipe);
 
@@ -89,24 +90,30 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output)
 	igt_remove_fb(data->drm_fd, &fb[0]);
 }
 
-igt_simple_main
+igt_main
 {
 	data_t data = {};
 	igt_output_t *output;
-	int valid_tests = 0;
 	enum pipe pipe;
 
-	data.drm_fd = drm_open_driver_master(DRIVER_ANY);
-	kmstest_set_vt_graphics_mode();
+	igt_fixture {
+		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+		kmstest_set_vt_graphics_mode();
 
-	igt_display_require(&data.display, data.drm_fd);
-
-	for_each_pipe_with_valid_output(&data.display, pipe, output) {
-		test(&data, pipe, output);
-		valid_tests++;
+		igt_display_require(&data.display, data.drm_fd);
+		igt_display_require_output(&data.display);
 	}
 
-	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
 
-	igt_display_fini(&data.display);
+	igt_subtest_with_dynamic("basic") {
+		for_each_pipe_with_valid_output(&data.display, pipe, output) {
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
+				test(&data, pipe, output);
+			}
+		}
+	}
+
+	igt_fixture {
+		igt_display_fini(&data.display);
+	}
 }
-- 
2.36.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-20 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-20  8:23 [igt-dev] [PATCH i-g-t v4] kms_flip_event_leak: Create dynamic subtests Jeevan B
2022-09-20 11:35 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_flip_event_leak: Create dynamic subtests (rev6) Patchwork
2022-09-20 16:55 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-20 18:43 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox