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 2/2] scripts/test_list.py: fix and simplify missing doc check
Date: Tue, 10 Oct 2023 15:17:20 +0200	[thread overview]
Message-ID: <20231010131743.535504-3-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20231010131743.535504-1-mauro.chehab@linux.intel.com>

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

Instead of using regexes, we can simply use sets to check what's
missing. This make checks easier and less error-prone.

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

diff --git a/scripts/test_list.py b/scripts/test_list.py
index daca290a02bd..c0462188ba8a 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1105,39 +1105,13 @@ class TestList:
 
             doc_subtests.add(subtest)
 
-        doc_subtests = list(sorted(doc_subtests))
-
         # Get a list of tests from
-        run_subtests = self.get_testlist()
+        run_subtests = set(self.get_testlist())
 
-        # Compare arrays
+        # Compare sets
 
-        run_missing = []
-        doc_uneeded = []
-
-        test_regex = r""
-        for doc_test in doc_subtests:
-            if test_regex != r"":
-                test_regex += r"|"
-            test_regex += doc_test
-
-        test_regex = re.compile(r'^(' + test_regex + r')$')
-
-        for doc_test in doc_subtests:
-            found = False
-            for run_test in run_subtests:
-                if test_regex.match(run_test):
-                    found = True
-                    break
-            if not found:
-                doc_uneeded.append(doc_test)
-
-        for run_test in run_subtests:
-            found = False
-            if test_regex.match(run_test):
-                found = True
-            if not found:
-                run_missing.append(run_test)
+        run_missing = list(sorted(run_subtests - doc_subtests))
+        doc_uneeded = list(sorted(doc_subtests - run_subtests))
 
         if doc_uneeded:
             for test_name in doc_uneeded:
-- 
2.41.0

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 13:17 [igt-dev] [PATCH i-g-t 0/2] Properly fix compilation breakage when Chamelium is disabled Mauro Carvalho Chehab
2023-10-10 13:17 ` [igt-dev] [PATCH i-g-t 1/2] testplan/meson.build: disable kms check testlist if not chamelium Mauro Carvalho Chehab
2023-10-10 14:59   ` Kamil Konieczny
2023-10-10 13:17 ` Mauro Carvalho Chehab [this message]
2023-10-10 15:15   ` [igt-dev] [PATCH i-g-t 2/2] scripts/test_list.py: fix and simplify missing doc check Kamil Konieczny
2023-10-10 17:56 ` [igt-dev] ✗ Fi.CI.BAT: failure for Properly fix compilation breakage when Chamelium is disabled 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=20231010131743.535504-3-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