[PATCH i-g-t v2 3/4] scripts/igt_doc.py: fix trivial case handling
Kamil Konieczny
kamil.konieczny at linux.intel.com
Mon Feb 26 11:04:49 UTC 2024
Hi Mauro,
On 2024-02-22 at 12:45:27 +0100, Mauro Carvalho Chehab wrote:
> 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
----------- ^^^^^^ -------------------------------------- ^^^^^^^
imho better to drop second "instead" word:
... expected: instead of checking for the gpu_set, it shall check ...
> check if the subnames dict is empty.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
> scripts/igt_doc.py | 37 +++++++++++++++++--------------------
> 1 file changed, 17 insertions(+), 20 deletions(-)
>
> diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
> index 7985cdd5ac5e..2417081b80be 100755
> --- a/scripts/igt_doc.py
> +++ b/scripts/igt_doc.py
> @@ -20,6 +20,7 @@ from test_list import TestList
> class IgtTestList(TestList):
> def __init__(self, *args, **kwargs):
> self.split_regex = re.compile(r",\s*")
> + self.default_gpu = "default"
>
> super().__init__(*args, **kwargs)
>
> @@ -122,30 +123,33 @@ class IgtTestList(TestList):
> # Create a testlist dictionary
>
> testlists = {}
> - default_gpu = "default"
>
> for driver, run_types in tests_per_list.items():
> testlists[driver] = {}
> + testlists[driver][self.default_gpu] = {}
> +
> for run_type, subnames in run_types.items():
> -
> if not run_type:
> run_type = "other"
>
> + if run_type not in testlists[driver][self.default_gpu]:
> + testlists[driver][self.default_gpu][run_type] = set()
> +
> 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] = {}
> + # If GPU field is used, default is to block list
> + default_gpu_value = True
> + for gpu, value in gpus.items():
> + if value:
> + default_gpu_value = False
> + break
>
> - if run_type not in testlists[driver][default_gpu]:
> - testlists[driver][default_gpu][run_type] = set()
> -
> - testlists[driver][default_gpu][run_type].add(subname)
> - continue
> + # Fill default values
> + if default_gpu_value:
> + testlists[driver][self.default_gpu][run_type].add(subname)
>
> if not gpus:
> for gpu in gpu_set:
> @@ -163,13 +167,6 @@ class IgtTestList(TestList):
> testlists[driver][gpu][run_type].add(subname)
> continue
>
> - # If GPU field is used, default is to block list
> - default_gpu_value = True
> - for gpu, value in gpus.items():
> - if value:
> - default_gpu_value = False
> - break
> -
> for gpu in gpu_set:
> value = tests_per_list[driver][run_type][subname].get(gpu, default_gpu_value)
>
> @@ -184,8 +181,8 @@ class IgtTestList(TestList):
>
> testlists[driver][gpu][run_type].add(subname)
>
> - if len(gpu_set) == 0:
> - gpu_set.add(default_gpu)
> + # Always create a default GPU
> + gpu_set.add(self.default_gpu)
>
> return (testlists, gpu_set)
>
> --
> 2.43.2
>
More information about the igt-dev
mailing list