Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] scripts/test_list: Create dir if it doesn't exist
@ 2023-05-05  6:14 Bhanuprakash Modem
  2023-05-05  6:48 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Bhanuprakash Modem @ 2023-05-05  6:14 UTC (permalink / raw)
  To: igt-dev, mchehab

To generate the testlist create the destination dir if it
doesn't exist.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@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)
+
             with open(fname, 'w', encoding='utf8') as handler:
                 for sub in test_subtests[test]:
                     handler.write (f"{sub}\n")
-- 
2.40.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] scripts/test_list: Create dir if it doesn't exist
  2023-05-05  6:14 [igt-dev] [PATCH i-g-t] scripts/test_list: Create dir if it doesn't exist Bhanuprakash Modem
@ 2023-05-05  6:48 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2023-05-05  6:48 UTC (permalink / raw)
  To: Bhanuprakash Modem; +Cc: igt-dev

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

> To generate the testlist create the destination dir if it
> doesn't exist.
> 
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@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@kernel.org>

Regards,
Mauro

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-05  6:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05  6:14 [igt-dev] [PATCH i-g-t] scripts/test_list: Create dir if it doesn't exist Bhanuprakash Modem
2023-05-05  6:48 ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox