Просмотр исходного кода

spec-test-script/runtest.py: Don't assume the tmp dir path (#3632)

The current coding assumes the tmp file is created in /tmp.
However,

* It's somewhere under /var/folders/... by default on macOS.

* A user can set TMPDIR.
YAMAMOTO Takashi 1 год назад
Родитель
Сommit
7c6fc70aea
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      tests/wamr-test-suites/spec-test-script/runtest.py

+ 3 - 0
tests/wamr-test-suites/spec-test-script/runtest.py

@@ -1158,6 +1158,9 @@ def run_wasm_with_repl(wasm_tempfile, aot_tempfile, opts, r):
     tmpfile = aot_tempfile if test_aot else wasm_tempfile
     log("Starting interpreter for module '%s'" % tmpfile)
 
+    if opts.qemu:
+        tmpfile = f"/tmp/{os.path.basename(tmpfile)}"
+
     cmd_iwasm = [opts.interpreter, "--heap-size=0", "-v=5" if opts.verbose else "-v=0", "--repl", tmpfile]
 
     if opts.multi_module: