From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] scripts/igt_doc.py: improve check tool to look at the right files
Date: Tue, 28 Mar 2023 15:54:34 +0200 [thread overview]
Message-ID: <20230328135434.2511771-1-mauro.chehab@linux.intel.com> (raw)
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
next reply other threads:[~2023-03-28 13:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 13:54 Mauro Carvalho Chehab [this message]
2023-03-28 17:51 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/igt_doc.py: improve check tool to look at the right files 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230328135434.2511771-1-mauro.chehab@linux.intel.com \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox