[PATCH i-g-t 3/3] scripts/igt_doc.py: fix trivial case handling
Mauro Carvalho Chehab
mauro.chehab at linux.intel.com
Thu Feb 22 07:40:01 UTC 2024
From: Mauro Carvalho Chehab <mchehab at kernel.org>
The check is done too late, causing it to not do what it was
expected: instead of checking for the gpu_set, it shall instead
check if the subnames dict is empty.
Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
scripts/igt_doc.py | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
index 7985cdd5ac5e..db2713e65fa3 100755
--- a/scripts/igt_doc.py
+++ b/scripts/igt_doc.py
@@ -124,6 +124,10 @@ class IgtTestList(TestList):
testlists = {}
default_gpu = "default"
+ # Always create a default GPU, as not all GPUs may be
+ # listed at include/exclude testlists
+ gpu_set.add(default_gpu)
+
for driver, run_types in tests_per_list.items():
testlists[driver] = {}
for run_type, subnames in run_types.items():
@@ -131,15 +135,10 @@ class IgtTestList(TestList):
if not run_type:
run_type = "other"
- for subname, gpus in subnames.items():
- # Globally blocklisted values: ignore subtest
- if "all" in tests_per_list[driver][run_type][subname]:
- continue
-
- # Trivial case: fields not defined: add subtest
- if not gpu_set:
- if default_gpu not in testlists[driver]:
- testlists[driver][default_gpu] = {}
+ # Trivial case: no GPUs defined for the test
+ if not subnames:
+ 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()
@@ -147,6 +146,11 @@ class IgtTestList(TestList):
testlists[driver][default_gpu][run_type].add(subname)
continue
+ for subname, gpus in subnames.items():
+ # Globally blocklisted values: ignore subtest
+ if "all" in tests_per_list[driver][run_type][subname]:
+ continue
+
if not gpus:
for gpu in gpu_set:
# blocked on all GPUs: ignore subtest
@@ -184,9 +188,6 @@ class IgtTestList(TestList):
testlists[driver][gpu][run_type].add(subname)
- if len(gpu_set) == 0:
- gpu_set.add(default_gpu)
-
return (testlists, gpu_set)
class IntelciTestlist:
--
2.43.2
More information about the igt-dev
mailing list