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 1/2] scripts/test_list.py: better expand subtests
Date: Fri, 24 Nov 2023 09:16:05 +0100	[thread overview]
Message-ID: <20231124081834.33714-2-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20231124081834.33714-1-mauro.chehab@linux.intel.com>

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

Use a better regex when splitting subtests, as used when reading
testlists.

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

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 13f788783483..5ff2b18c2dd8 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1010,6 +1010,9 @@ class TestList:
 
         order = None
 
+        if expand:
+            expand = re.compile(expand)
+
         if sort_field:
             if sort_field.lower() not in self.field_list:
                 sys.exit(f"Field '{sort_field}' is not defined")
@@ -1039,8 +1042,7 @@ class TestList:
             if sort_field:
                 if sort_field in subtest:
                     if expand:
-                        test_list = subtest[sort_field].split(expand)
-                        test_list = [s.strip() for s in test_list]
+                        test_list = expand.split(subtest[sort_field])
 
                         for test_elem in test_list:
                             if test_elem not in subtests:
@@ -1407,7 +1409,7 @@ class TestList:
 
 
         # NOTE: currently, it uses a comma for multi-value delimitter
-        test_subtests = self.get_subtests(sort_field, ",", with_order = True)
+        test_subtests = self.get_subtests(sort_field, ",\s*", with_order = True)
 
         if not os.path.exists(directory):
             os.makedirs(directory)
-- 
2.42.0

  reply	other threads:[~2023-11-24  8:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24  8:16 [igt-dev] [PATCH i-g-t 0/2] Small fixes/cleanups for test_list.py Mauro Carvalho Chehab
2023-11-24  8:16 ` Mauro Carvalho Chehab [this message]
2023-11-24 16:41   ` [igt-dev] [PATCH i-g-t 1/2] scripts/test_list.py: better expand subtests Kamil Konieczny
2023-11-24  8:16 ` [igt-dev] [PATCH i-g-t 2/2] scripts/test_list.py: don't add a blank description Mauro Carvalho Chehab
2023-11-24 16:42   ` Kamil Konieczny
2023-11-24  9:54 ` [igt-dev] ✓ Fi.CI.BAT: success for Small fixes/cleanups for test_list.py Patchwork
2023-11-24 10:22 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-11-25 13:39 ` [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=20231124081834.33714-2-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