[igt-dev] [PATCH i-g-t] tests/kms_rmfb: Create dynamic subtests

Mohammed Thasleem mohammed.thasleem at intel.com
Tue May 17 11:49:50 UTC 2022


Modified kms_rmfb to include dynamic test cases.

Signed-off-by: Mohammed Thasleem <mohammed.thasleem at intel.com>
---
 tests/kms_rmfb.c | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/tests/kms_rmfb.c b/tests/kms_rmfb.c
index fcd5cdad..45ab5f8d 100644
--- a/tests/kms_rmfb.c
+++ b/tests/kms_rmfb.c
@@ -146,19 +146,31 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo
 }
 
 static void
-run_rmfb_test(struct rmfb_data *data, bool reopen)
+run_rmfb_test(struct rmfb_data *data, bool reopen, const char *testname)
 {
 	igt_output_t *output;
 	enum pipe pipe;
 
-	for_each_pipe_with_single_output(&data->display, pipe, output)
+	for_each_pipe_with_single_output(&data->display, pipe, output) {
+		igt_dynamic_f("pipe-%s-%s-%s", kmstest_pipe_name(pipe),
+			      igt_output_name(output), testname)
 		test_rmfb(data, output, pipe, reopen);
+	}
 }
 
 igt_main
 {
+	int i;
 	struct rmfb_data data = {};
 
+	const struct {
+		bool flags;
+		const char *name;
+	} tests[] = {
+		{ true, "rmfb-ioctl" },
+		{ false, "close-fd" },
+	};
+
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
@@ -168,15 +180,16 @@ igt_main
 		igt_display_require_output(&data.display);
 	}
 
-	igt_describe("RMFB is supposed to free the framebuffers from any and all "
-		     "planes so test this and make sure it works.");
-	igt_subtest_f("rmfb-ioctl")
-		run_rmfb_test(&data, false);
+	for (i = 0; i < ARRAY_SIZE(tests); i++) {
+
+		igt_describe("RMFB is supposed to free the framebuffers from any and all "
+			     "planes so test this and make sure it works with rmfb-ioctl,"
+			     "fd close and reopen. ");
+		igt_subtest_with_dynamic(tests[i].name) {
+			run_rmfb_test(&data, tests[i].flags, tests[i].name);
 
-	igt_describe("RMFB is supposed to free the framebuffers from any and all planes "
-		     "so test this and make sure it works with fd close and reopen.");
-	igt_subtest_f("close-fd")
-		run_rmfb_test(&data, true);
+		}
+	}
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-- 
2.25.1



More information about the igt-dev mailing list