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: [PATCH i-g-t 5/8] scripts/igt_doc.py: better handle default gpu
Date: Fri,  9 Feb 2024 12:17:03 +0100	[thread overview]
Message-ID: <20240209111925.271717-6-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20240209111925.271717-1-mauro.chehab@linux.intel.com>

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

The variable "gpu" is used on several loops inside
gen_intelci_testlist(). That's confusing and error-pruned.

Instead, use "default_gpu" for the one used only for
default values.

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

diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
index 1c2c7a8ef973..fd1960dac6e0 100755
--- a/scripts/igt_doc.py
+++ b/scripts/igt_doc.py
@@ -107,6 +107,7 @@ class IgtTestList(TestList):
         # Create a testlist dictionary
 
         testlists = {}
+        default_gpu = "default"
 
         for driver, run_types in tests_per_list.items():
             testlists[driver] = {}
@@ -120,18 +121,15 @@ class IgtTestList(TestList):
                     if "all" in tests_per_list[driver][run_type][subname]:
                         continue
 
-                    if not gpu_set:
-                        gpu = "default"
-
                     # Trivial case: fields not defined: add subtest
                     if not gpu_set:
-                        if gpu not in testlists[driver]:
-                            testlists[driver][gpu] = {}
+                        if default_gpu not in testlists[driver]:
+                            testlists[driver][default_gpu] = {}
 
-                        if run_type not in testlists[driver][gpu]:
-                            testlists[driver][gpu][run_type] = set()
+                        if run_type not in testlists[driver][default_gpu]:
+                            testlists[driver][default_gpu][run_type] = set()
 
-                        testlists[driver][gpu][run_type].add(subname)
+                        testlists[driver][default_gpu][run_type].add(subname)
                         continue
 
                     if not gpus:
@@ -173,7 +171,16 @@ class IgtTestList(TestList):
                             testlists[driver][gpu][run_type].add(subname)
 
                     if default_gpu_value:
-                        testlists[driver][gpu][run_type].add(subname)
+                        if default_gpu not in testlists[driver]:
+                            testlists[driver][default_gpu] = {}
+
+                        if run_type not in testlists[driver][default_gpu]:
+                            testlists[driver][default_gpu][run_type] = set()
+
+                        testlists[driver][default_gpu][run_type].add(subname)
+
+        if len(gpu_set) == 0:
+            gpu_set.add(default_gpu)
 
         return (testlists, gpu_set)
 
-- 
2.43.0


  parent reply	other threads:[~2024-02-09 11:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 11:16 [PATCH i-g-t 0/8] Fix several issues when producing Intel CI testlists Mauro Carvalho Chehab
2024-02-09 11:16 ` [PATCH i-g-t 1/8] scripts/test_list.py: fix a typo on default-if-not-excluded Mauro Carvalho Chehab
2024-02-09 11:17 ` [PATCH i-g-t 2/8] scripts/igt_doc.py: better handle issues with empty testlists Mauro Carvalho Chehab
2024-02-09 11:17 ` [PATCH i-g-t 3/8] scripts/igt_doc.py: handle empty run_type Mauro Carvalho Chehab
2024-02-09 11:17 ` [PATCH i-g-t 4/8] scripts/igt_doc.py: only create dict if subtest will be added Mauro Carvalho Chehab
2024-02-09 11:17 ` Mauro Carvalho Chehab [this message]
2024-02-09 11:17 ` [PATCH i-g-t 6/8] scripts/igt_doc.py: remove some unused logic Mauro Carvalho Chehab
2024-02-09 11:17 ` [PATCH i-g-t 7/8] scripts/igt_doc.py: use an ancillary function to simplify the code Mauro Carvalho Chehab
2024-02-09 11:17 ` [PATCH i-g-t 8/8] scripts/igt_doc.py: simplify and cleanup tests_per_list logic Mauro Carvalho Chehab
2024-02-09 11:37 ` ✗ Fi.CI.BUILD: failure for Fix several issues when producing Intel CI testlists 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=20240209111925.271717-6-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