[igt-dev] [PATCH i-g-t 2/3] scripts/test_list.py: add a check for missing features

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Thu Aug 10 12:32:30 UTC 2023


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

Some fields shall always be present at the documentation.

Add a check for it.

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

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 4f580fb3de58..c23d6d735edf 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -936,13 +936,27 @@ class TestList:
         if self.filters:
             print("NOTE: test checks are affected by filters")
 
+        mandatory_fields = set()
+        for field, item in self.props.items():
+            if item["_properties_"].get("mandatory"):
+                    mandatory_fields.add(field)
+
         doc_subtests = set()
 
         args_regex = re.compile(r'\<[^\>]+\>')
 
-        for subtest in self.get_subtests()[""]:
+        missing_mandatory_fields = False
+
+        subtests = self.expand_dictionary(True)
+        for subtest, data in sorted(subtests.items()):
             subtest = "@".join(subtest.split("@")[:3])
             subtest = args_regex.sub(r'\\d+', subtest)
+
+            for field in mandatory_fields:
+                if field not in data:
+                    print(f"Warning: {subtest} {field} documentation is missing")
+                    missing_mandatory_fields = True
+
             doc_subtests.add(subtest)
 
         doc_subtests = list(sorted(doc_subtests))
-- 
2.41.0



More information about the igt-dev mailing list