Skip to content

Commit 4e31bd6

Browse files
wamr-test-suites: Clean up generated tmp files after spec test (#3700)
Add all possible generated tmp files to the list, those not actually generated will be simply ignored in the deletion process.
1 parent da31c07 commit 4e31bd6

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

tests/wamr-test-suites/spec-test-script/all.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,8 @@ def main():
572572
if options.parl_flag:
573573
# several cases might share the same workspace/tempfile at the same time
574574
# so, disable it while running parallelly
575-
options.clean_up_flag = False
575+
if options.multi_module_flag:
576+
options.clean_up_flag = False
576577
options.verbose_flag = False
577578

578579
start = time.time_ns()

tests/wamr-test-suites/spec-test-script/runtest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,12 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
13071307
wasm_tempfile = create_tmp_file(".wasm")
13081308
if test_aot:
13091309
aot_tempfile = create_tmp_file(".aot")
1310+
# could be potientially compiled to aot
1311+
# with the future following call test_assert_xxx,
1312+
# add them to temp_file_repo now even if no actual following file,
1313+
# it will be simple ignore during final deletion if not exist
1314+
prefix = wasm_tempfile.split(".wasm")[0]
1315+
temp_file_repo.append(prefix + ".aot")
13101316

13111317
ret_code = 0
13121318
try:
@@ -1429,6 +1435,12 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
14291435

14301436
if test_aot:
14311437
r = compile_wasm_to_aot(temp_files[1], temp_files[2], True, opts, r)
1438+
# could be potientially compiled to aot
1439+
# with the future following call test_assert_xxx,
1440+
# add them to temp_file_repo now even if no actual following file,
1441+
# it will be simple ignore during final deletion if not exist
1442+
prefix = temp_files[1].split(".wasm")[0]
1443+
temp_file_repo.append(prefix + ".aot")
14321444
try:
14331445
assert_prompt(r, ['Compile success'], opts.start_timeout, False)
14341446
except:

0 commit comments

Comments
 (0)