[igt-dev] [PATCH i-g-t] Revert "scripts/test_list.py: fix and simplify missing doc check"

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Oct 9 18:04:32 UTC 2023


Hi Juha-Pekka,
On 2023-10-09 at 21:01:18 +0300, Juha-Pekka Heikkila wrote:
> This fixes the build without chamelium
> 
> This reverts commit 334a1178a36a1327dc7fbba43ab16d1f3a7d887b.
> 
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>

Acked-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  scripts/test_list.py | 34 ++++++++++++++++++++++++++++++----
>  1 file changed, 30 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index c0462188b..daca290a0 100644
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -1105,13 +1105,39 @@ class TestList:
>  
>              doc_subtests.add(subtest)
>  
> +        doc_subtests = list(sorted(doc_subtests))
> +
>          # Get a list of tests from
> -        run_subtests = set(self.get_testlist())
> +        run_subtests = self.get_testlist()
> +
> +        # Compare arrays
> +
> +        run_missing = []
> +        doc_uneeded = []
>  
> -        # Compare sets
> +        test_regex = r""
> +        for doc_test in doc_subtests:
> +            if test_regex != r"":
> +                test_regex += r"|"
> +            test_regex += doc_test
>  
> -        run_missing = list(sorted(run_subtests - doc_subtests))
> -        doc_uneeded = list(sorted(doc_subtests - run_subtests))
> +        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)
>  
>          if doc_uneeded:
>              for test_name in doc_uneeded:
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list