Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix regex filtering logic
Date: Thu,  2 Nov 2023 14:06:26 +0100	[thread overview]
Message-ID: <20231102130957.307435-5-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20231102130957.307435-1-mauro.chehab@linux.intel.com>

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

Normal regular expressions don't seek from the beginning.
However, Python re.match is actually an alias for:

	/^<regex/

Seeking from the beginning. Fix it by using, instead,
re.search(), which handles regular expressions the standard
way.

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

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 252fda576c92..a7758d5ecb91 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -500,10 +500,10 @@ class TestList:
 
         for filter_field, regex in self.filters.items():
             if filter_field in subtest:
-                if not regex.match(subtest[filter_field]):
+                if not regex.search(subtest[filter_field]):
                     return True
             elif filter_field in test:
-                if not regex.match(test[filter_field]):
+                if not regex.search(test[filter_field]):
                     return True
             else:
                 return field_not_found_value
-- 
2.41.0

  parent reply	other threads:[~2023-11-02 13:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 13:06 [igt-dev] [PATCH i-g-t 0/5] Fix a series of issues while handling testlist Mauro Carvalho Chehab
2023-11-02 13:06 ` [igt-dev] [PATCH i-g-t 1/5] scripts/test_list.py: better parse list of tests Mauro Carvalho Chehab
2023-11-02 14:57   ` Kamil Konieczny
2023-11-02 13:06 ` [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: speedup update testlist logic Mauro Carvalho Chehab
2023-11-02 14:37   ` Kamil Konieczny
2023-11-02 13:06 ` [igt-dev] [PATCH i-g-t 3/5] intel/*.json: better handle FULL testlist Mauro Carvalho Chehab
2023-11-02 14:39   ` Kamil Konieczny
2023-11-02 13:06 ` Mauro Carvalho Chehab [this message]
2023-11-02 14:49   ` [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix regex filtering logic Kamil Konieczny
2023-11-02 13:06 ` [igt-dev] [PATCH i-g-t 5/5] scripts/test_list.py: use different types for include/exclude Mauro Carvalho Chehab
2023-11-02 14:52   ` 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=20231102130957.307435-5-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