Skip to content

Commit 9813e4f

Browse files
committed
fix(runtest.py): Enhance module name handling and improve error messages for missing files
1 parent 2e9756d commit 9813e4f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,15 +1499,17 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
14991499
# get module's new name from the register cmd
15001500
name_new =re.split('\"',re.search('\".*\"',form).group(0))[1]
15011501
if name_new:
1502-
new_module = os.path.join(tempfile.gettempdir(), name_new + ".wasm")
15031502
if not name_new in temp_module_table:
1504-
print(f"can not find module name {name_new} from the register")
1503+
print(f"can not find module name {name_new} from the register, use {wasm_tempfile} instead")
15051504

15061505
just_generated = temp_module_table.get(name_new, wasm_tempfile)
15071506
if not os.path.exists(just_generated):
15081507
raise Exception("can not find file %s" % just_generated)
15091508

15101509
print("f{just_generated} is copied to {new_module}")
1510+
1511+
# copy the just generated module into a file with specific name
1512+
new_module = os.path.join(tempfile.gettempdir(), name_new + ".wasm")
15111513
shutil.copyfile(just_generated, new_module)
15121514

15131515
# add new_module copied from the old into temp_file_repo[]

0 commit comments

Comments
 (0)