[igt-dev] [PATCH i-g-t 08/10] kms_plane_cursor: Use dynamic subtests

Petri Latvala petri.latvala at intel.com
Fri Aug 16 09:34:24 UTC 2019


Instead of for_each_pipe_static, use for_each_pipe with a dynamic
subtest per pipe.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
 tests/kms_plane_cursor.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
index cbad0041..ed19a9b0 100644
--- a/tests/kms_plane_cursor.c
+++ b/tests/kms_plane_cursor.c
@@ -318,22 +318,24 @@ igt_main
 		igt_display_require_output(&data.display);
 	}
 
-	for_each_pipe_static(pipe)
-		for (i = 0; i < ARRAY_SIZE(cursor_sizes); ++i) {
-			int size = cursor_sizes[i];
-
-			igt_subtest_f("pipe-%s-overlay-size-%d",
-				      kmstest_pipe_name(pipe), size)
-				test_cursor_overlay(&data, size, pipe);
-
-			igt_subtest_f("pipe-%s-primary-size-%d",
-				      kmstest_pipe_name(pipe), size)
-				test_cursor_primary(&data, size, pipe);
-
-			igt_subtest_f("pipe-%s-viewport-size-%d",
-				      kmstest_pipe_name(pipe), size)
-				test_cursor_viewport(&data, size, pipe);
-		}
+	for (i = 0; i < ARRAY_SIZE(cursor_sizes); ++i) {
+		int size = cursor_sizes[i];
+
+		igt_dynamic_subtest_container_f("overlay-size-%d", size)
+			for_each_pipe(&data.display, pipe)
+				igt_dynamic_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
+					test_cursor_overlay(&data, size, pipe);
+
+		igt_dynamic_subtest_container_f("primary-size-%d", size)
+			for_each_pipe(&data.display, pipe)
+				igt_dynamic_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
+					test_cursor_primary(&data, size, pipe);
+
+		igt_dynamic_subtest_container_f("viewport-size-%d", size)
+			for_each_pipe(&data.display, pipe)
+				igt_dynamic_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
+					test_cursor_viewport(&data, size, pipe);
+	}
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-- 
2.19.1



More information about the igt-dev mailing list