[igt-dev] [PATCH i-g-t 08/11] scripts/test_list.py: add support for igt_simple_main

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Mon Mar 27 13:31:52 UTC 2023


From: Mauro Carvalho Chehab <mchehab at kernel.org>

when igt_simple_main is used, there will be a single unamed
subtest. Add support for it.

On such case, the documentation will be like:

	/**
	 * TEST: Test foo
	 * Category: Software building block
	 * Sub-category: foo
	 * Test category: functionality test
	 * Run type: BAT
	 *
	 * SUBTEST:
	 * Description: foo description
	 */

Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
 scripts/test_list.py | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 7d35deda3329..075f44d5e604 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -176,6 +176,22 @@ class TestList:
 
     The SUBTEST contains the fields that are specific to each subtest.
 
+    Note: when igt_simple_main is used, there will be a single nameless
+    subtest. On such case, "SUBTEST:" is still needed, but without a
+    test name on it, e. g., it would be documented as:
+
+        /**
+         * TEST: some test that uses igt_simple_main
+         * Category: Software build block
+         * Sub-category: documentation
+         * Functionality: test documentation
+         * Issue: none
+         * Description: Complete description of this test
+         *
+         * SUBTEST:
+         * Description: do foo things
+         */
+
     Some IGT tests may have strings or integer wildcards, like:
         test-%s-%ld-size
 
@@ -376,8 +392,9 @@ class TestList:
         subtest_array = []
 
         for subtest in self.doc[test]["subtest"].keys():
-            summary = test_name + '@' + self.doc[test]["subtest"][subtest]["Summary"]
-
+            summary = test_name
+            if self.doc[test]["subtest"][subtest]["Summary"] != '':
+                 summary += '@' + self.doc[test]["subtest"][subtest]["Summary"]
             if not summary:
                 continue
 
-- 
2.39.2



More information about the igt-dev mailing list