From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/3] scripts/test_list.py: use a compiled regex for check
Date: Wed, 12 Apr 2023 14:35:45 +0200 [thread overview]
Message-ID: <20230412123544.119534-4-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230412123544.119534-1-mauro.chehab@linux.intel.com>
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Speed up even further the logic for --check-testlist by
pre-compiling the regex that will be used to validate the
results.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index 287351e717b3..acdd1cac4c20 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -820,10 +820,18 @@ class TestList:
run_missing = []
doc_uneeded = []
+ test_regex = r""
+ for doc_test in doc_subtests:
+ if test_regex != r"":
+ test_regex += r"|"
+ test_regex += r'^' + doc_test + r'$'
+
+ test_regex = re.compile(test_regex)
+
for doc_test in doc_subtests:
found = False
for run_test in run_subtests:
- if re.match(r'^' + doc_test + r'$', run_test):
+ if re.match(test_regex, run_test):
found = True
break
if not found:
@@ -832,7 +840,7 @@ class TestList:
for run_test in run_subtests:
found = False
for doc_test in doc_subtests:
- if re.match(r'^' + doc_test + r'$', run_test):
+ if re.match(test_regex, run_test):
found = True
break
if not found:
--
2.39.2
next prev parent reply other threads:[~2023-04-12 12:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 12:35 [igt-dev] [PATCH i-g-t 0/3] ./scripts/igt_doc.py: speedup check logic Mauro Carvalho Chehab
2023-04-12 12:35 ` [igt-dev] [PATCH i-g-t 1/3] scripts/igt_doc.py: cleanup some pylint warnings Mauro Carvalho Chehab
2023-04-12 12:35 ` [igt-dev] [PATCH i-g-t 2/3] scripts/igt_doc.py: don't depend on igt_runner anymore Mauro Carvalho Chehab
2023-04-12 12:35 ` Mauro Carvalho Chehab [this message]
2023-04-12 13:24 ` [igt-dev] ✓ Fi.CI.BAT: success for ./scripts/igt_doc.py: speedup check logic Patchwork
2023-04-12 21:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20230412123544.119534-4-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