scripts/test_list: Create dir if it doesn't exist
PATCH 1/1 scripts/test_list: Create dir if it doesn't exist
To generate the testlist create the destination dir if it doesn't exist.
Signed-off-by Bhanuprakash Modem <[email protected]>
--- scripts/test_list.py | 3 +++ 1 file changed, 3 insertions(+)
scripts/test_list.py +3 -0
@@ -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")
Signature · 1 line
2.40.0
Quoted 13 lines · On Fri, 5 May 2023 11:44:31 +0530 Bhanuprakash Modem…
To generate the testlist create the destination dir if it doesn't exist.
Signed-off-by Bhanuprakash Modem <[email protected]>--- scripts/test_list.py | 3 +++ 1 file changed, 3 insertions(+)scripts/test_list.py +0
-0
scripts/test_list.py class TestList: · line 1154
Quoted 6 lines
scripts/test_list.py +3
-0@@ -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 <[email protected]>
Regards,
Mauro