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/3] scripts/test_list.py: allow ignoring uppercase on testlist read
Date: Fri, 13 Oct 2023 11:29:27 +0200	[thread overview]
Message-ID: <20231013093152.737239-2-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20231013093152.737239-1-mauro.chehab@linux.intel.com>

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

There are some tests in KMS which uses uppercase names. Add a
config option on test_list.py json handler to allow parsing
testlist regular expressions on a case-insensitive way.

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

diff --git a/scripts/test_list.py b/scripts/test_list.py
index c0462188ba8a..c75d15bfca73 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -321,6 +321,10 @@ class TestList:
             self.props["Class"]["_properties_"]["level"] = 1
             self.props["Class"]["_properties_"]["sublevel"] = sublevel_count[0] + 1
 
+        flags = 0
+        if self.config.get("case_insensitive_testlist", False):
+            flags |= re.IGNORECASE
+
         # Remove non-multilevel items, as we're only interested on
         # hierarchical item levels here
         for field, item in self.props.items():
@@ -335,7 +339,7 @@ class TestList:
                 testlist = {}
                 for value in item["_properties_"]["testlists"]:
                     for name in value.keys():
-                        self.read_testlist(testlist, name, cfg_path + value[name])
+                        self.read_testlist(testlist, name, cfg_path + value[name], flags)
 
                 item["_properties_"]["testlist"] = testlist
 
@@ -344,7 +348,7 @@ class TestList:
                 blocklist = {}
                 for value in item["_properties_"]["blocklists"]:
                     for name in value.keys():
-                        self.read_testlist(testlist, name, cfg_path + value[name])
+                        self.read_testlist(testlist, name, cfg_path + value[name], flags)
 
                 item["_properties_"]["blocklist"] = blocklist
 
@@ -448,7 +452,7 @@ class TestList:
 
             self.__add_field(key, sublevel, hierarchy_level, field[key])
 
-    def read_testlist(self, testlist, name, filename):
+    def read_testlist(self, testlist, name, filename, flags):
         base = r"^\s*({}[^\s\{}]+)(\S*)\s*(\#.*)?$"
         regex = re.compile(base.format(self.main_name, self.subtest_separator))
 
@@ -462,7 +466,7 @@ class TestList:
                     subtest = match.group(2)
                     if not subtest.endswith("$"):
                         subtest += r"(\@.*)?$"
-                    testlist[name].append(re.compile(f"{test}{subtest}"))
+                    testlist[name].append(re.compile(f"{test}{subtest}", flags))
 
     def __filter_subtest(self, test, subtest, field_not_found_value):
 
-- 
2.41.0

  reply	other threads:[~2023-10-13  9:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13  9:29 [igt-dev] [PATCH i-g-t 0/3] Improve testlist parsing by test_list.py Mauro Carvalho Chehab
2023-10-13  9:29 ` Mauro Carvalho Chehab [this message]
2023-10-13 14:42   ` [igt-dev] [PATCH i-g-t 1/3] scripts/test_list.py: allow ignoring uppercase on testlist read Kamil Konieczny
2023-10-13  9:29 ` [igt-dev] [PATCH i-g-t 2/3] intel/kms_test_config.json: set testlist read parser to ignore case Mauro Carvalho Chehab
2023-10-13 14:43   ` Kamil Konieczny
2023-10-13  9:29 ` [igt-dev] [PATCH i-g-t 3/3] scripts/test_list.py: better name testlist include/exclude config fields Mauro Carvalho Chehab
2023-10-13 14:46   ` Kamil Konieczny
2023-10-13 15:10     ` Mauro Carvalho Chehab
2023-10-13 12:52 ` [igt-dev] ✓ Fi.CI.BAT: success for Improve testlist parsing by test_list.py Patchwork
2023-10-13 13:40 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-10-14 14:01 ` [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=20231013093152.737239-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