[igt-dev] [PATCH i-g-t] scripts/test_list: don't mangle directory names

Modem, Bhanuprakash bhanuprakash.modem at intel.com
Fri May 5 06:20:41 UTC 2023


Hi Mauro,

On Fri-05-05-2023 11:09 am, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab at kernel.org>
> 
> While we want to standardize the testlist file names to use
> "-" instead of "_", such rule doesn't apply for the directory
> name.
> 
> While here, make the replace regex more generic by replacing
> any non word/digit character sequences to "-".
> 
> Reported-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
> ---
>   scripts/test_list.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index e7d486858eb4..a0db07125bc4 100755
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -1156,8 +1156,8 @@ class TestList:
>               else:
>                   fname = testlist
>   
> +            fname = re.sub(r"[^\w\d]+", "-", fname)
>               fname = directory + "/" + test_prefix + fname + ".testlist"
> -            fname = re.sub(r"[\s_]+", "-", fname)

LGTM
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>

- Bhanu

>   
>               with open(fname, 'w', encoding='utf8') as handler:
>                   for sub in test_subtests[test]:


More information about the igt-dev mailing list