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

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri May 5 07:00:17 UTC 2023


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

V2: - Move the logic to outside the loop (Mauro)

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
 scripts/test_list.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 855950506..9a909e364 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1134,6 +1134,9 @@ class TestList:
 
         test_subtests = self.get_subtests(sort_field)
 
+        if not os.path.exists(directory):
+            os.makedirs(directory)
+
         for test in test_subtests.keys():  # pylint: disable=C0201,C0206
             if not test_subtests[test]:
                 continue
-- 
2.40.0



More information about the igt-dev mailing list