summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2018-01-24 16:27:28 -0800
committerGitHub <noreply@github.com>2018-01-24 16:27:28 -0800
commit7360bc9536203d949b7f11872e51252ae04cb366 (patch)
tree48868b66ef9ce31a8b63374c50ff56b4dce98b6a
parent89e86d1c68df2a9308b299643070535635eb5cf9 (diff)
downloadwabt-7360bc9536203d949b7f11872e51252ae04cb366.tar.gz
wabt-7360bc9536203d949b7f11872e51252ae04cb366.tar.bz2
wabt-7360bc9536203d949b7f11872e51252ae04cb366.zip
Remove `run-objdump.py`; replace with `RUN` cmds (#732)
* Remove `run-objdump.py`; replace with `RUN` cmds This CL introduces two new TOOLs for tests: * `run-objdump-gen-wasm`: Run objdump on wasm files generated by `gen-wasm.py`. * `run-objdump-spec`: Run objdump on wasm files generated by `wast2json`. For now, this requires each test to specify the files manually: `%(temp_file)s.0.wasm %(temp_file)s.1.wasm` etc. `gen_wasm_py` has been added as a new RUN variable as well. * Call FixPythonExecutable after expanding variables
-rw-r--r--test/README.md6
-rw-r--r--test/dump/atomic.txt2
-rw-r--r--test/dump/bad-version-logging.txt7
-rw-r--r--test/dump/bad-version.txt6
-rw-r--r--test/dump/basic.txt3
-rw-r--r--test/dump/binary.txt2
-rw-r--r--test/dump/block-257-exprs-br.txt2
-rw-r--r--test/dump/block-257-exprs.txt2
-rw-r--r--test/dump/block.txt2
-rw-r--r--test/dump/br-block-named.txt2
-rw-r--r--test/dump/br-block.txt2
-rw-r--r--test/dump/br-loop-inner-expr.txt2
-rw-r--r--test/dump/br-loop-inner.txt2
-rw-r--r--test/dump/br-loop.txt2
-rw-r--r--test/dump/brif-loop.txt2
-rw-r--r--test/dump/brif.txt2
-rw-r--r--test/dump/brtable-empty.txt2
-rw-r--r--test/dump/brtable.txt2
-rw-r--r--test/dump/call.txt2
-rw-r--r--test/dump/callimport.txt2
-rw-r--r--test/dump/callindirect.txt2
-rw-r--r--test/dump/cast.txt2
-rw-r--r--test/dump/compare.txt2
-rw-r--r--test/dump/const.txt2
-rw-r--r--test/dump/convert-sat.txt2
-rw-r--r--test/dump/convert.txt2
-rw-r--r--test/dump/current-memory.txt2
-rw-r--r--test/dump/debug-import-names.txt3
-rw-r--r--test/dump/debug-names.txt3
-rw-r--r--test/dump/dedupe-sig.txt2
-rw-r--r--test/dump/drop.txt2
-rw-r--r--test/dump/export-multi.txt2
-rw-r--r--test/dump/expr-br.txt2
-rw-r--r--test/dump/expr-brif.txt2
-rw-r--r--test/dump/func-exported.txt2
-rw-r--r--test/dump/func-multi.txt2
-rw-r--r--test/dump/func-named.txt2
-rw-r--r--test/dump/getglobal.txt2
-rw-r--r--test/dump/getlocal-param.txt2
-rw-r--r--test/dump/getlocal.txt2
-rw-r--r--test/dump/global.txt3
-rw-r--r--test/dump/grow-memory.txt2
-rw-r--r--test/dump/hexfloat_f32.txt2
-rw-r--r--test/dump/hexfloat_f64.txt2
-rw-r--r--test/dump/if-then-else-list.txt2
-rw-r--r--test/dump/if-then-list.txt2
-rw-r--r--test/dump/if.txt2
-rw-r--r--test/dump/import.txt3
-rw-r--r--test/dump/load-aligned.txt2
-rw-r--r--test/dump/load.txt2
-rw-r--r--test/dump/locals.txt2
-rw-r--r--test/dump/loop-257-exprs-br.txt2
-rw-r--r--test/dump/loop-257-exprs.txt2
-rw-r--r--test/dump/loop.txt2
-rw-r--r--test/dump/memory-1-byte.txt2
-rw-r--r--test/dump/memory-data-size.txt5
-rw-r--r--test/dump/memory-hex.txt2
-rw-r--r--test/dump/memory.txt3
-rw-r--r--test/dump/multi_file.txt4
-rw-r--r--test/dump/mutable-global.txt3
-rw-r--r--test/dump/no-canonicalize.txt2
-rw-r--r--test/dump/nocheck.txt2
-rw-r--r--test/dump/nop.txt2
-rw-r--r--test/dump/param-multi.txt2
-rw-r--r--test/dump/relocations.txt3
-rw-r--r--test/dump/result.txt2
-rw-r--r--test/dump/return.txt2
-rw-r--r--test/dump/select.txt2
-rw-r--r--test/dump/setglobal.txt2
-rw-r--r--test/dump/setlocal-param.txt2
-rw-r--r--test/dump/setlocal.txt2
-rw-r--r--test/dump/signatures.txt2
-rw-r--r--test/dump/start.txt3
-rw-r--r--test/dump/store-aligned.txt2
-rw-r--r--test/dump/store.txt2
-rw-r--r--test/dump/string-escape.txt2
-rw-r--r--test/dump/string-hex.txt2
-rw-r--r--test/dump/table.txt3
-rw-r--r--test/dump/tee_local.txt2
-rw-r--r--test/dump/try-details.txt3
-rw-r--r--test/dump/try-exports-details.txt3
-rw-r--r--test/dump/try-exports.txt3
-rw-r--r--test/dump/try-imports-details.txt3
-rw-r--r--test/dump/try-imports.txt3
-rw-r--r--test/dump/try.txt3
-rw-r--r--test/dump/unary-extend.txt2
-rw-r--r--test/dump/unary.txt2
-rw-r--r--test/dump/unreachable.txt2
-rw-r--r--test/find_exe.py2
-rwxr-xr-xtest/run-gen-wasm-interp.py3
-rwxr-xr-xtest/run-gen-wasm.py5
-rwxr-xr-xtest/run-objdump.py137
-rwxr-xr-xtest/run-tests.py25
93 files changed, 136 insertions, 246 deletions
diff --git a/test/README.md b/test/README.md
index 1fdd7449..438a7c65 100644
--- a/test/README.md
+++ b/test/README.md
@@ -119,6 +119,12 @@ The currently supported list of tools (see
format.
- `run-objdump`: parse a wasm text file, convert it to binary, then run
`wasm-objdump` on it.
+- `run-objdump-gen-wasm`: parse a "gen-wasm" text file, convert it to binary,
+ then run `wasm-objdump` on it.
+- `run-objdump-spec`: parse a wast spec test file, convert it to JSON and a
+ collection of `.wasm` files, then run `wasm-objdump`. Note that the `.wasm`
+ files are not automatically passed to `wasm-objdump`, so each test must
+ specify them manually: `%(temp_file)s.0.wasm %(temp_file)s.1.wasm`, etc.
- `run-wasm-link`: parses a wasm text file which may contain multiple modules,
convert them to binary, then link them together via `wasm-link`.
- `run-roundtrip`: parse a wasm text file, convert it to binary, convert it
diff --git a/test/dump/atomic.txt b/test/dump/atomic.txt
index 6356e586..8cf7c4dc 100644
--- a/test/dump/atomic.txt
+++ b/test/dump/atomic.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: --enable-threads
+;;; ARGS0: --enable-threads
(module
(memory 1 1 shared)
diff --git a/test/dump/bad-version-logging.txt b/test/dump/bad-version-logging.txt
index 66988400..4df88d40 100644
--- a/test/dump/bad-version-logging.txt
+++ b/test/dump/bad-version-logging.txt
@@ -1,12 +1,11 @@
;;; ERROR: 1
-;;; TOOL: run-objdump
-;;; ARGS: --gen-wasm --dump-debug
+;;; TOOL: run-objdump-gen-wasm
+;;; ARGS1: --debug
magic
0xe 0 0 0
(;; STDERR ;;;
-Error running "wasm-objdump":
+Generating LALR tables
*ERROR*: @0x00000008: bad wasm file version: 0xe (expected 0x1)
-
;;; STDERR ;;)
(;; STDOUT ;;;
diff --git a/test/dump/bad-version.txt b/test/dump/bad-version.txt
index 05711a78..a0eb111a 100644
--- a/test/dump/bad-version.txt
+++ b/test/dump/bad-version.txt
@@ -1,12 +1,10 @@
;;; ERROR: 1
-;;; TOOL: run-objdump
-;;; ARGS: --gen-wasm
+;;; TOOL: run-objdump-gen-wasm
magic
0xe 0 0 0
(;; STDERR ;;;
-Error running "wasm-objdump":
+Generating LALR tables
*ERROR*: @0x00000008: bad wasm file version: 0xe (expected 0x1)
-
;;; STDERR ;;)
(;; STDOUT ;;;
diff --git a/test/dump/basic.txt b/test/dump/basic.txt
index 55d544df..edda7b4f 100644
--- a/test/dump/basic.txt
+++ b/test/dump/basic.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --headers
+;;; ARGS0: -v
+;;; ARGS1: --headers
(module
(memory 1)
(func $f (param i32 i32) (result i32)
diff --git a/test/dump/binary.txt b/test/dump/binary.txt
index c747d9ca..b3e5350e 100644
--- a/test/dump/binary.txt
+++ b/test/dump/binary.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 0
diff --git a/test/dump/block-257-exprs-br.txt b/test/dump/block-257-exprs-br.txt
index d33bb3d4..507dab1b 100644
--- a/test/dump/block-257-exprs-br.txt
+++ b/test/dump/block-257-exprs-br.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block $foo
diff --git a/test/dump/block-257-exprs.txt b/test/dump/block-257-exprs.txt
index 7f32462f..d2d7df01 100644
--- a/test/dump/block-257-exprs.txt
+++ b/test/dump/block-257-exprs.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block
diff --git a/test/dump/block.txt b/test/dump/block.txt
index 571a2da7..0cf8444b 100644
--- a/test/dump/block.txt
+++ b/test/dump/block.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block
diff --git a/test/dump/br-block-named.txt b/test/dump/br-block-named.txt
index 12d8bea5..49cfdb5a 100644
--- a/test/dump/br-block-named.txt
+++ b/test/dump/br-block-named.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block $outer ;; 3
diff --git a/test/dump/br-block.txt b/test/dump/br-block.txt
index dbbf0ae5..451c8072 100644
--- a/test/dump/br-block.txt
+++ b/test/dump/br-block.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func ;; depth
block $outer ;; 4
diff --git a/test/dump/br-loop-inner-expr.txt b/test/dump/br-loop-inner-expr.txt
index 9d2cbbe7..36644040 100644
--- a/test/dump/br-loop-inner-expr.txt
+++ b/test/dump/br-loop-inner-expr.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (result i32)
block $exit (result i32)
diff --git a/test/dump/br-loop-inner.txt b/test/dump/br-loop-inner.txt
index cd603098..ba628e5e 100644
--- a/test/dump/br-loop-inner.txt
+++ b/test/dump/br-loop-inner.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
(block $exit (loop $cont
diff --git a/test/dump/br-loop.txt b/test/dump/br-loop.txt
index 8495e86e..a27ae027 100644
--- a/test/dump/br-loop.txt
+++ b/test/dump/br-loop.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
loop $cont
diff --git a/test/dump/brif-loop.txt b/test/dump/brif-loop.txt
index 1f9ddf7b..5b840bf6 100644
--- a/test/dump/brif-loop.txt
+++ b/test/dump/brif-loop.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
loop $cont
diff --git a/test/dump/brif.txt b/test/dump/brif.txt
index 310490cc..50c7150d 100644
--- a/test/dump/brif.txt
+++ b/test/dump/brif.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block $foo
diff --git a/test/dump/brtable-empty.txt b/test/dump/brtable-empty.txt
index 96199b0b..6674d177 100644
--- a/test/dump/brtable-empty.txt
+++ b/test/dump/brtable-empty.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block
diff --git a/test/dump/brtable.txt b/test/dump/brtable.txt
index ec4bff79..fccf2d12 100644
--- a/test/dump/brtable.txt
+++ b/test/dump/brtable.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block
diff --git a/test/dump/call.txt b/test/dump/call.txt
index b066cad7..31eeb8a1 100644
--- a/test/dump/call.txt
+++ b/test/dump/call.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (param i32)
i32.const 1
diff --git a/test/dump/callimport.txt b/test/dump/callimport.txt
index 037cf279..63e9d3a4 100644
--- a/test/dump/callimport.txt
+++ b/test/dump/callimport.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(import "foo" "bar" (func (param i32 f32) (result i32)))
(func (result i32)
diff --git a/test/dump/callindirect.txt b/test/dump/callindirect.txt
index da72dc0a..bc563fe8 100644
--- a/test/dump/callindirect.txt
+++ b/test/dump/callindirect.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(type $t (func (param i32)))
(func $f (type $t)
diff --git a/test/dump/cast.txt b/test/dump/cast.txt
index b06d526a..e61d03bb 100644
--- a/test/dump/cast.txt
+++ b/test/dump/cast.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 0
diff --git a/test/dump/compare.txt b/test/dump/compare.txt
index 59f50dd2..af097983 100644
--- a/test/dump/compare.txt
+++ b/test/dump/compare.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 0
diff --git a/test/dump/const.txt b/test/dump/const.txt
index 314e493d..e34a785e 100644
--- a/test/dump/const.txt
+++ b/test/dump/const.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 0
diff --git a/test/dump/convert-sat.txt b/test/dump/convert-sat.txt
index f29e96b4..48beedf7 100644
--- a/test/dump/convert-sat.txt
+++ b/test/dump/convert-sat.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --enable-saturating-float-to-int
+;;; ARGS0: -v --enable-saturating-float-to-int
(module
(func
f32.const 0
diff --git a/test/dump/convert.txt b/test/dump/convert.txt
index 2acd95fe..56d21f70 100644
--- a/test/dump/convert.txt
+++ b/test/dump/convert.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 0
diff --git a/test/dump/current-memory.txt b/test/dump/current-memory.txt
index d0e6bdb6..b21816b1 100644
--- a/test/dump/current-memory.txt
+++ b/test/dump/current-memory.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(memory 1)
(func (result i32)
diff --git a/test/dump/debug-import-names.txt b/test/dump/debug-import-names.txt
index 56da227a..471f7a99 100644
--- a/test/dump/debug-import-names.txt
+++ b/test/dump/debug-import-names.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: --headers -v --debug-names --dump-verbose
+;;; ARGS0: -v --debug-names
+;;; ARGS1: --headers -x
(module
(import "bar" "foo" (func $foo)))
(;; STDOUT ;;;
diff --git a/test/dump/debug-names.txt b/test/dump/debug-names.txt
index 9fc8a1fd..622afe1a 100644
--- a/test/dump/debug-names.txt
+++ b/test/dump/debug-names.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --debug-names --dump-verbose
+;;; ARGS0: -v --debug-names
+;;; ARGS1: -x
(module
(func $F1 (param $F1P0 i32)
(local $F1L1 f32)
diff --git a/test/dump/dedupe-sig.txt b/test/dump/dedupe-sig.txt
index 6c2db802..95e1ee4a 100644
--- a/test/dump/dedupe-sig.txt
+++ b/test/dump/dedupe-sig.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(type (func (param i32) (result i64)))
(import "foo" "bar" (func (param i32) (result i64)))
diff --git a/test/dump/drop.txt b/test/dump/drop.txt
index f2a65d59..e3f5ce3a 100644
--- a/test/dump/drop.txt
+++ b/test/dump/drop.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 0
diff --git a/test/dump/export-multi.txt b/test/dump/export-multi.txt
index b4516bfe..9986f0a8 100644
--- a/test/dump/export-multi.txt
+++ b/test/dump/export-multi.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (nop))
(export "a" (func 0))
diff --git a/test/dump/expr-br.txt b/test/dump/expr-br.txt
index 286aca25..0780459b 100644
--- a/test/dump/expr-br.txt
+++ b/test/dump/expr-br.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (result i32)
block (result i32)
diff --git a/test/dump/expr-brif.txt b/test/dump/expr-brif.txt
index 99607b60..a2fa92d9 100644
--- a/test/dump/expr-brif.txt
+++ b/test/dump/expr-brif.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (result i32)
block $exit (result i32)
diff --git a/test/dump/func-exported.txt b/test/dump/func-exported.txt
index 67d0cad1..a0ccbf68 100644
--- a/test/dump/func-exported.txt
+++ b/test/dump/func-exported.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func)
(export "foo" (func 0)))
diff --git a/test/dump/func-multi.txt b/test/dump/func-multi.txt
index 20031312..ad95e6b1 100644
--- a/test/dump/func-multi.txt
+++ b/test/dump/func-multi.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func)
(func)
diff --git a/test/dump/func-named.txt b/test/dump/func-named.txt
index 2a73642f..7ee4188b 100644
--- a/test/dump/func-named.txt
+++ b/test/dump/func-named.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func $my-func))
(;; STDOUT ;;;
diff --git a/test/dump/getglobal.txt b/test/dump/getglobal.txt
index 3a815ea3..a543d243 100644
--- a/test/dump/getglobal.txt
+++ b/test/dump/getglobal.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(global i32 (i32.const 0))
(func (result i32)
diff --git a/test/dump/getlocal-param.txt b/test/dump/getlocal-param.txt
index 14232a0b..ed724f18 100644
--- a/test/dump/getlocal-param.txt
+++ b/test/dump/getlocal-param.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (param i32 f32)
(local i64 f32 i32 f32)
diff --git a/test/dump/getlocal.txt b/test/dump/getlocal.txt
index 48a2abb7..cf7b6808 100644
--- a/test/dump/getlocal.txt
+++ b/test/dump/getlocal.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
(local f64 f32 i64 i32 i32 f32 f64 i64)
diff --git a/test/dump/global.txt b/test/dump/global.txt
index 6e6ee186..290404aa 100644
--- a/test/dump/global.txt
+++ b/test/dump/global.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --dump-verbose
+;;; ARGS0: -v
+;;; ARGS1: -x
(module
(import "foo" "i32_global" (global i32))
(import "foo" "i64_global" (global i64))
diff --git a/test/dump/grow-memory.txt b/test/dump/grow-memory.txt
index 310dc1ac..084f84f1 100644
--- a/test/dump/grow-memory.txt
+++ b/test/dump/grow-memory.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(memory 1 2)
(func (param i32)
diff --git a/test/dump/hexfloat_f32.txt b/test/dump/hexfloat_f32.txt
index 366f3595..82c6ab7b 100644
--- a/test/dump/hexfloat_f32.txt
+++ b/test/dump/hexfloat_f32.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
f32.const 0x0p0
diff --git a/test/dump/hexfloat_f64.txt b/test/dump/hexfloat_f64.txt
index bea5e81b..e224cb0a 100644
--- a/test/dump/hexfloat_f64.txt
+++ b/test/dump/hexfloat_f64.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
f64.const 0x0p0
diff --git a/test/dump/if-then-else-list.txt b/test/dump/if-then-else-list.txt
index dc005265..7eda9b1c 100644
--- a/test/dump/if-then-else-list.txt
+++ b/test/dump/if-then-else-list.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 1
diff --git a/test/dump/if-then-list.txt b/test/dump/if-then-list.txt
index 32427430..ea8bd2e2 100644
--- a/test/dump/if-then-list.txt
+++ b/test/dump/if-then-list.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 1
diff --git a/test/dump/if.txt b/test/dump/if.txt
index d330bee3..81288a7d 100644
--- a/test/dump/if.txt
+++ b/test/dump/if.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 1
diff --git a/test/dump/import.txt b/test/dump/import.txt
index 0fa855ff..71ce2b66 100644
--- a/test/dump/import.txt
+++ b/test/dump/import.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --dump-verbose
+;;; ARGS0: -v
+;;; ARGS1: -x
(module
(import "ignored" "test" (func (param i32 i64 f32 f64)))
(import "ignored" "test2" (func (param i32) (result i32)))
diff --git a/test/dump/load-aligned.txt b/test/dump/load-aligned.txt
index 0a62fdf8..aaa2a7e3 100644
--- a/test/dump/load-aligned.txt
+++ b/test/dump/load-aligned.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(memory 1)
(func
diff --git a/test/dump/load.txt b/test/dump/load.txt
index c71ecf16..3f256f9f 100644
--- a/test/dump/load.txt
+++ b/test/dump/load.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(memory 1)
(func
diff --git a/test/dump/locals.txt b/test/dump/locals.txt
index 4fd7576b..dd92c947 100644
--- a/test/dump/locals.txt
+++ b/test/dump/locals.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (local i32 i64 i64 f32 f32 f32 f64 f64 f64 f64)))
(;; STDOUT ;;;
diff --git a/test/dump/loop-257-exprs-br.txt b/test/dump/loop-257-exprs-br.txt
index 5b31908f..7e26c6a0 100644
--- a/test/dump/loop-257-exprs-br.txt
+++ b/test/dump/loop-257-exprs-br.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
block $outer
diff --git a/test/dump/loop-257-exprs.txt b/test/dump/loop-257-exprs.txt
index eaa26232..e2689e8f 100644
--- a/test/dump/loop-257-exprs.txt
+++ b/test/dump/loop-257-exprs.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
loop
diff --git a/test/dump/loop.txt b/test/dump/loop.txt
index aa6240c5..b277323a 100644
--- a/test/dump/loop.txt
+++ b/test/dump/loop.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
loop
diff --git a/test/dump/memory-1-byte.txt b/test/dump/memory-1-byte.txt
index 127f2008..1c71c4ee 100644
--- a/test/dump/memory-1-byte.txt
+++ b/test/dump/memory-1-byte.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module (memory 1))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
diff --git a/test/dump/memory-data-size.txt b/test/dump/memory-data-size.txt
index b682b192..0f25b47d 100644
--- a/test/dump/memory-data-size.txt
+++ b/test/dump/memory-data-size.txt
@@ -1,5 +1,6 @@
-;;; TOOL: run-objdump
-;;; ARGS: -v --spec
+;;; TOOL: run-objdump-spec
+;;; ARGS0: -v
+;;; ARGS1: %(temp_file)s.0.wasm %(temp_file)s.1.wasm %(temp_file)s.2.wasm %(temp_file)s.3.wasm
(module (memory 1))
(module (memory 2))
(module (memory 4))
diff --git a/test/dump/memory-hex.txt b/test/dump/memory-hex.txt
index 407002d5..a1cdfd3b 100644
--- a/test/dump/memory-hex.txt
+++ b/test/dump/memory-hex.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(memory
(data "\00\01\02\03\04\05\06\07\08\09\0a")))
diff --git a/test/dump/memory.txt b/test/dump/memory.txt
index 9795b978..5ea12c13 100644
--- a/test/dump/memory.txt
+++ b/test/dump/memory.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --dump-verbose
+;;; ARGS0: -v
+;;; ARGS1: -x
(module
(memory 1)
(data (i32.const 10) "hello")
diff --git a/test/dump/multi_file.txt b/test/dump/multi_file.txt
index 3d2e5a76..ae237d53 100644
--- a/test/dump/multi_file.txt
+++ b/test/dump/multi_file.txt
@@ -1,5 +1,5 @@
-;;; TOOL: run-objdump
-;;; ARGS: --headers --spec
+;;; TOOL: run-objdump-spec
+;;; ARGS1: --headers %(temp_file)s.0.wasm %(temp_file)s.1.wasm
(module
(func (param $param2 i64))
)
diff --git a/test/dump/mutable-global.txt b/test/dump/mutable-global.txt
index c92840bd..5cac9336 100644
--- a/test/dump/mutable-global.txt
+++ b/test/dump/mutable-global.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --dump-verbose --enable-mutable-globals
+;;; ARGS0: -v --enable-mutable-globals
+;;; ARGS1: -x
(module
(import "foo" "imported" (global (mut i32)))
(global (export "exported") (mut i32) (i32.const 1)))
diff --git a/test/dump/no-canonicalize.txt b/test/dump/no-canonicalize.txt
index 6a4b8e8b..e5d366ea 100644
--- a/test/dump/no-canonicalize.txt
+++ b/test/dump/no-canonicalize.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --no-canonicalize-leb128s
+;;; ARGS0: -v --no-canonicalize-leb128s
(module
(import "stdio" "print" (func (param i32)))
(memory 100)
diff --git a/test/dump/nocheck.txt b/test/dump/nocheck.txt
index 39e50c86..1e69c27d 100644
--- a/test/dump/nocheck.txt
+++ b/test/dump/nocheck.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --no-check
+;;; ARGS0: -v --no-check
(module
(func (result i64)
f32.const 1
diff --git a/test/dump/nop.txt b/test/dump/nop.txt
index b16a190e..42412d15 100644
--- a/test/dump/nop.txt
+++ b/test/dump/nop.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
nop))
diff --git a/test/dump/param-multi.txt b/test/dump/param-multi.txt
index e8f70726..55fea9ae 100644
--- a/test/dump/param-multi.txt
+++ b/test/dump/param-multi.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (param i32 i64 f32 f64)))
(;; STDOUT ;;;
diff --git a/test/dump/relocations.txt b/test/dump/relocations.txt
index ea2c2d9d..5292ca5e 100644
--- a/test/dump/relocations.txt
+++ b/test/dump/relocations.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: --headers -r
+;;; ARGS0: -r
+;;; ARGS1: --headers
(module
(type $t (func (param i32)))
(import "__extern" "foo" (func (param i32) (result i32)))
diff --git a/test/dump/result.txt b/test/dump/result.txt
index db404523..e9f73f0d 100644
--- a/test/dump/result.txt
+++ b/test/dump/result.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (result i32)
i32.const 0)
diff --git a/test/dump/return.txt b/test/dump/return.txt
index a212b393..b34464f6 100644
--- a/test/dump/return.txt
+++ b/test/dump/return.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func (result i32)
i32.const 42
diff --git a/test/dump/select.txt b/test/dump/select.txt
index d43812b5..63ca283d 100644
--- a/test/dump/select.txt
+++ b/test/dump/select.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 2
diff --git a/test/dump/setglobal.txt b/test/dump/setglobal.txt
index fdf34b1f..9369e2fc 100644
--- a/test/dump/setglobal.txt
+++ b/test/dump/setglobal.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(global f32 (f32.const 1))
(func
diff --git a/test/dump/setlocal-param.txt b/test/dump/setlocal-param.txt
index db3c9296..cfafdb01 100644
--- a/test/dump/setlocal-param.txt
+++ b/test/dump/setlocal-param.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
;; 0 1
(func (param i32 f32)
diff --git a/test/dump/setlocal.txt b/test/dump/setlocal.txt
index 7e908c63..6a379fbc 100644
--- a/test/dump/setlocal.txt
+++ b/test/dump/setlocal.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
;; i32 0 1
diff --git a/test/dump/signatures.txt b/test/dump/signatures.txt
index 233f2bc8..24c732ce 100644
--- a/test/dump/signatures.txt
+++ b/test/dump/signatures.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(type (func (param i32)))
(type (func (param i64)))
diff --git a/test/dump/start.txt b/test/dump/start.txt
index 13629735..a5f65113 100644
--- a/test/dump/start.txt
+++ b/test/dump/start.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --dump-verbose --headers
+;;; ARGS0: -v
+;;; ARGS1: -x --headers
(module
(func $a)
(func $b)
diff --git a/test/dump/store-aligned.txt b/test/dump/store-aligned.txt
index 27aeb3a1..ed4cb08f 100644
--- a/test/dump/store-aligned.txt
+++ b/test/dump/store-aligned.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(memory 1)
(func
diff --git a/test/dump/store.txt b/test/dump/store.txt
index 3a44ae7d..c747620b 100644
--- a/test/dump/store.txt
+++ b/test/dump/store.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(memory 1)
(func
diff --git a/test/dump/string-escape.txt b/test/dump/string-escape.txt
index 36101680..6b0efe50 100644
--- a/test/dump/string-escape.txt
+++ b/test/dump/string-escape.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module (func) (export "tab:\t newline:\n slash:\\ quote:\' double:\"" (func 0)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
diff --git a/test/dump/string-hex.txt b/test/dump/string-hex.txt
index ed004bb0..7ca143bd 100644
--- a/test/dump/string-hex.txt
+++ b/test/dump/string-hex.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module (func) (export "foo\de\ad\ca\bb" (func 0)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
diff --git a/test/dump/table.txt b/test/dump/table.txt
index d7dd5cbf..b2e1d930 100644
--- a/test/dump/table.txt
+++ b/test/dump/table.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --dump-verbose
+;;; ARGS0: -v
+;;; ARGS1: -x
(module
(type $t (func (param i32)))
(func (type $t))
diff --git a/test/dump/tee_local.txt b/test/dump/tee_local.txt
index a72e9a0f..6911f78b 100644
--- a/test/dump/tee_local.txt
+++ b/test/dump/tee_local.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
(local i32)
diff --git a/test/dump/try-details.txt b/test/dump/try-details.txt
index e8dfcb2f..b40fb2cf 100644
--- a/test/dump/try-details.txt
+++ b/test/dump/try-details.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: --dump-verbose --enable-exceptions
+;;; ARGS0: --enable-exceptions
+;;; ARGS1: -x
(module
(except $ex i32)
(func (result i32)
diff --git a/test/dump/try-exports-details.txt b/test/dump/try-exports-details.txt
index 8e2fed0c..30c68ece 100644
--- a/test/dump/try-exports-details.txt
+++ b/test/dump/try-exports-details.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: --dump-verbose --enable-exceptions
+;;; ARGS0: --enable-exceptions
+;;; ARGS1: -x
(module
(except $ex i32)
(export "except" (except $ex))
diff --git a/test/dump/try-exports.txt b/test/dump/try-exports.txt
index 66b7a43b..13e917c2 100644
--- a/test/dump/try-exports.txt
+++ b/test/dump/try-exports.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --headers --enable-exceptions
+;;; ARGS0: -v --enable-exceptions
+;;; ARGS1: --headers
(module
(except $ex i32)
(export "except" (except $ex))
diff --git a/test/dump/try-imports-details.txt b/test/dump/try-imports-details.txt
index 1c59f30b..a62ab303 100644
--- a/test/dump/try-imports-details.txt
+++ b/test/dump/try-imports-details.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: --dump-verbose --enable-exceptions
+;;; ARGS0: --enable-exceptions
+;;; ARGS1: -x
(module
(import "c++" "except" (except $ex i32))
(func (result i32)
diff --git a/test/dump/try-imports.txt b/test/dump/try-imports.txt
index 4a4542e9..56f0fc3b 100644
--- a/test/dump/try-imports.txt
+++ b/test/dump/try-imports.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --headers --enable-exceptions
+;;; ARGS0: -v --enable-exceptions
+;;; ARGS1: --headers
(module
(import "c++" "except" (except $ex i32))
(func (result i32)
diff --git a/test/dump/try.txt b/test/dump/try.txt
index c57b558d..aadda90b 100644
--- a/test/dump/try.txt
+++ b/test/dump/try.txt
@@ -1,5 +1,6 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --headers --enable-exceptions
+;;; ARGS0: -v --enable-exceptions
+;;; ARGS1: --headers
(module
(except $ex i32)
(func (result i32)
diff --git a/test/dump/unary-extend.txt b/test/dump/unary-extend.txt
index e9d2d912..729c22d0 100644
--- a/test/dump/unary-extend.txt
+++ b/test/dump/unary-extend.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v --enable-sign-extension
+;;; ARGS0: -v --enable-sign-extension
(module
(func
i32.const 0
diff --git a/test/dump/unary.txt b/test/dump/unary.txt
index 85f948a6..9a476373 100644
--- a/test/dump/unary.txt
+++ b/test/dump/unary.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
i32.const 0
diff --git a/test/dump/unreachable.txt b/test/dump/unreachable.txt
index 5b34eaae..874e4047 100644
--- a/test/dump/unreachable.txt
+++ b/test/dump/unreachable.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-objdump
-;;; ARGS: -v
+;;; ARGS0: -v
(module
(func
unreachable))
diff --git a/test/find_exe.py b/test/find_exe.py
index 8bc19d41..de2500a2 100644
--- a/test/find_exe.py
+++ b/test/find_exe.py
@@ -29,6 +29,8 @@ EXECUTABLES = [
'wasm-validate', 'wasm2c',
]
+GEN_WASM_PY = os.path.join(SCRIPT_DIR, 'gen-wasm.py')
+
def GetDefaultPath():
return os.path.join(REPO_ROOT_DIR, 'bin')
diff --git a/test/run-gen-wasm-interp.py b/test/run-gen-wasm-interp.py
index 8db33855..6319652b 100755
--- a/test/run-gen-wasm-interp.py
+++ b/test/run-gen-wasm-interp.py
@@ -25,7 +25,6 @@ import utils
from utils import Error
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-GEN_WASM_PY = os.path.join(SCRIPT_DIR, 'gen-wasm.py')
def main(args):
@@ -49,7 +48,7 @@ def main(args):
parser.add_argument('file', help='test file.')
options = parser.parse_args(args)
- gen_wasm = utils.Executable(sys.executable, GEN_WASM_PY,
+ gen_wasm = utils.Executable(sys.executable, find_exe.GEN_WASM_PY,
error_cmdline=options.error_cmdline)
wasm_interp = utils.Executable(
diff --git a/test/run-gen-wasm.py b/test/run-gen-wasm.py
index 0d8344f0..c0603f10 100755
--- a/test/run-gen-wasm.py
+++ b/test/run-gen-wasm.py
@@ -27,7 +27,6 @@ import utils
from utils import Error
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-GEN_WASM_PY = os.path.join(SCRIPT_DIR, 'gen-wasm.py')
def main(args):
@@ -51,9 +50,9 @@ def main(args):
parser.add_argument('file', help='test file.')
options = parser.parse_args(args)
- gen_wasm = utils.Executable(sys.executable, GEN_WASM_PY,
+ gen_wasm = utils.Executable(sys.executable, find_exe.GEN_WASM_PY,
error_cmdline=options.error_cmdline,
- basename=os.path.basename(GEN_WASM_PY))
+ basename=os.path.basename(find_exe.GEN_WASM_PY))
objdump = utils.Executable(
find_exe.GetWasmdumpExecutable(options.bindir),
diff --git a/test/run-objdump.py b/test/run-objdump.py
deleted file mode 100755
index a891bdb1..00000000
--- a/test/run-objdump.py
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 WebAssembly Community Group participants
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import argparse
-import os
-import sys
-import tempfile
-
-import find_exe
-import utils
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-GEN_WASM_PY = os.path.join(SCRIPT_DIR, 'gen-wasm.py')
-
-def main(args):
- parser = argparse.ArgumentParser()
- parser.add_argument('-v', '--verbose', help='print more diagnotic messages.',
- action='store_true')
- parser.add_argument('-o', '--out-dir', metavar='PATH',
- help='output directory for files.')
- parser.add_argument('--bindir', metavar='PATH',
- default=find_exe.GetDefaultPath(),
- help='directory to search for all executables.')
- parser.add_argument('--no-error-cmdline',
- help='don\'t display the subprocess\'s commandline when'
- + ' an error occurs', dest='error_cmdline',
- action='store_false')
- parser.add_argument('-p', '--print-cmd',
- help='print the commands that are run.',
- action='store_true')
- parser.add_argument('--headers', action='store_true')
- parser.add_argument('--no-check', action='store_true')
- parser.add_argument('--dump-verbose', action='store_true')
- parser.add_argument('--dump-debug', action='store_true')
- parser.add_argument('--enable-exceptions', action='store_true')
- parser.add_argument('--enable-mutable-globals', action='store_true')
- parser.add_argument('--enable-saturating-float-to-int', action='store_true')
- parser.add_argument('--enable-sign-extension', action='store_true')
- parser.add_argument('--enable-simd', action='store_true')
- parser.add_argument('--enable-threads', action='store_true')
- parser.add_argument('--gen-wasm', action='store_true',
- help='parse with gen-wasm')
- parser.add_argument('--spec', action='store_true')
- parser.add_argument('-r', '--relocatable', action='store_true')
- parser.add_argument('--no-canonicalize-leb128s', action='store_true')
- parser.add_argument('--debug-names', action='store_true')
- parser.add_argument('file', help='test file.')
- options = parser.parse_args(args)
-
- if options.gen_wasm and options.spec:
- parser.error('Can\'t use both --gen-wasm and --spec')
-
- gen_wasm = utils.Executable(sys.executable, GEN_WASM_PY,
- error_cmdline=options.error_cmdline)
-
- wat_tool = None
- if options.spec:
- wat_tool = utils.Executable(
- find_exe.GetWast2JsonExecutable(options.bindir),
- error_cmdline=options.error_cmdline)
- else:
- wat_tool = utils.Executable(
- find_exe.GetWat2WasmExecutable(options.bindir),
- error_cmdline=options.error_cmdline)
-
- wat_tool.AppendOptionalArgs({
- '--debug-names': options.debug_names,
- '--enable-exceptions': options.enable_exceptions,
- '--enable-mutable-globals': options.enable_mutable_globals,
- '--enable-saturating-float-to-int':
- options.enable_saturating_float_to_int,
- '--enable-sign-extension': options.enable_sign_extension,
- '--enable-simd': options.enable_simd,
- '--enable-threads': options.enable_threads,
- '--no-check': options.no_check,
- '--no-canonicalize-leb128s': options.no_canonicalize_leb128s,
- '-v': options.verbose,
- '-r': options.relocatable,
- })
-
- wasm_objdump = utils.Executable(
- find_exe.GetWasmdumpExecutable(options.bindir),
- error_cmdline=options.error_cmdline)
- wasm_objdump.AppendOptionalArgs({
- '-h': options.headers,
- '-x': options.dump_verbose,
- '--debug': options.dump_debug,
- })
-
- gen_wasm.verbose = options.print_cmd
- wat_tool.verbose = options.print_cmd
- wasm_objdump.verbose = options.print_cmd
-
- filename = options.file
-
- with utils.TempDirectory(options.out_dir, 'objdump-') as out_dir:
- basename = os.path.basename(filename)
- basename_noext = os.path.splitext(basename)[0]
- if options.gen_wasm:
- out_file = os.path.join(out_dir, basename_noext + '.wasm')
- gen_wasm.RunWithArgs('-o', out_file, filename)
- else:
- if options.spec:
- out_file = os.path.join(out_dir, basename_noext + '.json')
- else:
- out_file = os.path.join(out_dir, basename_noext + '.wasm')
- wat_tool.RunWithArgs('-o', out_file, filename)
-
- if options.spec:
- wasm_files = utils.GetModuleFilenamesFromSpecJSON(out_file)
- wasm_files = [utils.ChangeDir(f, out_dir) for f in wasm_files]
- else:
- wasm_files = [out_file]
-
- wasm_objdump.RunWithArgs('-r', '-d', *wasm_files)
-
-
-if __name__ == '__main__':
- try:
- sys.exit(main(sys.argv[1:]))
- except utils.Error as e:
- sys.stderr.write(str(e) + '\n')
- sys.exit(1)
diff --git a/test/run-tests.py b/test/run-tests.py
index 7e73b0c3..2ca96e36 100755
--- a/test/run-tests.py
+++ b/test/run-tests.py
@@ -56,13 +56,19 @@ TOOLS = {
('ARGS', ['%(in_file)s']),
],
'run-objdump': [
- ('RUN', 'test/run-objdump.py'),
- ('ARGS', [
- '%(in_file)s',
- '--bindir=%(bindir)s',
- '--no-error-cmdline',
- '-o', '%(out_dir)s'
- ]),
+ ('RUN', '%(wat2wasm)s %(in_file)s -o %(temp_file)s.wasm'),
+ ('RUN', '%(wasm-objdump)s -r -d %(temp_file)s.wasm'),
+ ('VERBOSE-ARGS', ['-v']),
+ ],
+ 'run-objdump-gen-wasm': [
+ ('RUN', '%(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm'),
+ ('RUN', '%(wasm-objdump)s -r -d %(temp_file)s.wasm'),
+ ('VERBOSE-ARGS', ['-v']),
+ ],
+ 'run-objdump-spec': [
+ ('RUN', '%(wast2json)s %(in_file)s -o %(temp_file)s.json'),
+ # NOTE: wasm files must be passed in manually via ARGS1
+ ('RUN', '%(wasm-objdump)s -r -d'),
('VERBOSE-ARGS', ['-v']),
],
'run-wasm-link': [
@@ -204,7 +210,7 @@ def FixPythonExecutable(args):
class CommandTemplate(object):
def __init__(self, exe):
- self.args = FixPythonExecutable(SplitArgs(exe))
+ self.args = SplitArgs(exe)
self.verbose_args = []
def AppendArgs(self, args):
@@ -228,7 +234,7 @@ class CommandTemplate(object):
if extra_args:
args += extra_args
args = self._Format(args, variables)
- return Command(args)
+ return Command(FixPythonExecutable(args))
class Command(object):
@@ -883,6 +889,7 @@ def main(args):
variables = {}
variables['test_dir'] = os.path.abspath(TEST_DIR)
variables['bindir'] = options.bindir
+ variables['gen_wasm_py'] = find_exe.GEN_WASM_PY
for exe_basename in find_exe.EXECUTABLES:
exe_override = os.path.join(options.bindir, exe_basename)
variables[exe_basename] = find_exe.FindExecutable(exe_basename,