[igt-dev] [PATCH i-g-t] scripts/test_list: Create dir if it doesn't exist

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Fri May 5 06:48:44 UTC 2023


On Fri,  5 May 2023 11:44:31 +0530
Bhanuprakash Modem <bhanuprakash.modem at intel.com> wrote:

> To generate the testlist create the destination dir if it
> doesn't exist.
> 
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>  scripts/test_list.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index 1c5e195eb..9ae1cd154 100755
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -1149,6 +1149,9 @@ class TestList:
>              fname = directory + "/" + test_prefix + fname + ".testlist"
>              fname = re.sub(r"[\s_]+", "-", fname)
>  
> +            if not os.path.exists(directory):
> +                os.makedirs(directory)
> +

Don't need to have it inside the for loop, as the directory is
the same for all test lists.

After moving it to be before the "for test in test_subtests.keys():"
loop:

Reviewed-by: Mauro Carvalho Chehab <mchehab at kernel.org>

Regards,
Mauro


More information about the igt-dev mailing list