Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] scripts/igt_doc.py: improve check tool to look at the right files
@ 2023-03-28 13:54 Mauro Carvalho Chehab
  2023-03-28 17:51 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2023-03-28 13:54 UTC (permalink / raw)
  To: igt-dev

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

We can't rely only at the prefix, as a test list could include files
from other places.

So, add a logic to look into the files listed at the configuration
file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/igt_doc.py | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
index 92d925c451ed..f52d458bec60 100755
--- a/scripts/igt_doc.py
+++ b/scripts/igt_doc.py
@@ -757,11 +757,18 @@ class TestList:
 
         """Compare documented subtests with the IGT test list"""
 
+        test_prefixes = {}
+
+        for cfg_file in self.config["files"]:
+            prefix = "^igt@" + re.sub(r"(.*/)?(.*)\.[ch]",r"\2", cfg_file)
+            test_prefixes[prefix] = 1
+
         doc_subtests = sorted(self.get_subtests()[""])
 
         for i in range(0, len(doc_subtests)): # pylint: disable=C0200
             doc_subtests[i] = re.sub(r'\<[^\>]+\>', r'\\d+', doc_subtests[i])
 
+        # Just to optimize the runner
         test_prefix = os.path.commonprefix(doc_subtests)
 
         # Get a list of tests from
@@ -775,7 +782,17 @@ class TestList:
             print("Error:", sub_err)
             sys.exit(1)
 
-        run_subtests = sorted(result.stdout.splitlines())
+        run_subtests = []
+        for subtest in result.stdout.splitlines():
+            found = 0
+            for prefix in test_prefixes.keys():
+                if re.match(prefix, subtest):
+                    found = 1
+                    break
+            if found:
+                run_subtests.append(subtest)
+
+        run_subtests = sorted(run_subtests)
 
         # Compare arrays
 
-- 
2.39.2

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

end of thread, other threads:[~2023-04-04 15:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-28 13:54 [igt-dev] [PATCH i-g-t] scripts/igt_doc.py: improve check tool to look at the right files Mauro Carvalho Chehab
2023-03-28 17:51 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-29  6:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-04-04 15:47 ` [igt-dev] [PATCH i-g-t] " Kamil Konieczny

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