diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/interp/callimport-zero-args.txt | 2 | ||||
-rw-r--r-- | test/interp/empty.txt | 2 | ||||
-rw-r--r-- | test/interp/import.txt | 4 | ||||
-rw-r--r-- | test/interp/return-void.txt | 4 | ||||
-rwxr-xr-x | test/run-interp.py | 5 | ||||
-rwxr-xr-x | test/run-wasmdump.py | 5 | ||||
-rw-r--r-- | test/spec/address.txt | 82 | ||||
-rw-r--r-- | test/spec/float_exprs.txt | 22 | ||||
-rw-r--r-- | test/spec/float_memory.txt | 50 | ||||
-rw-r--r-- | test/spec/func_ptrs.txt | 6 | ||||
-rw-r--r-- | test/spec/memory_redundancy.txt | 6 | ||||
-rw-r--r-- | test/spec/names.txt | 8 | ||||
-rw-r--r-- | test/spec/start.txt | 14 | ||||
-rw-r--r-- | test/utils.py | 7 |
14 files changed, 109 insertions, 108 deletions
diff --git a/test/interp/callimport-zero-args.txt b/test/interp/callimport-zero-args.txt index 1281134b..0419d7ed 100644 --- a/test/interp/callimport-zero-args.txt +++ b/test/interp/callimport-zero-args.txt @@ -7,6 +7,6 @@ call $imported i32.add)) (;; STDOUT ;;; -called host spectest.print() => (i32:0) +called host spectest.print() => i32:0 f() => i32:13 ;;; STDOUT ;;) diff --git a/test/interp/empty.txt b/test/interp/empty.txt index b126f168..ab3807d3 100644 --- a/test/interp/empty.txt +++ b/test/interp/empty.txt @@ -2,5 +2,5 @@ (module (func (export "f"))) (;; STDOUT ;;; -f() => +f() => ;;; STDOUT ;;) diff --git a/test/interp/import.txt b/test/interp/import.txt index e84f765d..17bd8216 100644 --- a/test/interp/import.txt +++ b/test/interp/import.txt @@ -12,7 +12,7 @@ return) ) (;; STDOUT ;;; -called host spectest.print(i32:100) => () -called host spectest.print(i32:200, i32:300) => () +called host spectest.print(i32:100) => +called host spectest.print(i32:200, i32:300) => test() => i32:1 ;;; STDOUT ;;) diff --git a/test/interp/return-void.txt b/test/interp/return-void.txt index 8ce78300..728600ef 100644 --- a/test/interp/return-void.txt +++ b/test/interp/return-void.txt @@ -28,8 +28,8 @@ i32.const 0 i32.load)) (;; STDOUT ;;; -test1() => +test1() => check1() => i32:0 -test2() => +test2() => check2() => i32:1 ;;; STDOUT ;;) diff --git a/test/run-interp.py b/test/run-interp.py index caae7672..6c3dc1b8 100755 --- a/test/run-interp.py +++ b/test/run-interp.py @@ -16,7 +16,6 @@ # import argparse -import json import os import subprocess import sys @@ -83,9 +82,7 @@ def main(args): out_file = utils.ChangeDir(utils.ChangeExt(options.file, new_ext), out_dir) wast2wasm.RunWithArgs(options.file, '-o', out_file) if options.spec: - with open(out_file) as json_file: - json_data = json.load(json_file) - wasm_files = [m['filename'] for m in json_data['modules']] + wasm_files = utils.GetModuleFilenamesFromSpecJSON(out_file) wasm_files = [utils.ChangeDir(f, out_dir) for f in wasm_files] else: wasm_files = [out_file] diff --git a/test/run-wasmdump.py b/test/run-wasmdump.py index ec0628bb..7055e59a 100755 --- a/test/run-wasmdump.py +++ b/test/run-wasmdump.py @@ -16,7 +16,6 @@ # import argparse -import json import os import sys import tempfile @@ -80,9 +79,7 @@ def main(args): wast2wasm.RunWithArgs('-o', out_file, filename) if options.spec: - with open(out_file) as json_file: - json_data = json.load(json_file) - wasm_files = [m['filename'] for m in json_data['modules']] + wasm_files = utils.GetModuleFilenamesFromSpecJSON(out_file) wasm_files = [utils.ChangeDir(f, out_dir) for f in wasm_files] else: wasm_files = [out_file] diff --git a/test/spec/address.txt b/test/spec/address.txt index 1cf125c0..e93f5594 100644 --- a/test/spec/address.txt +++ b/test/spec/address.txt @@ -1,45 +1,45 @@ ;;; TOOL: run-interp-spec ;;; STDIN_FILE: third_party/testsuite/address.wast (;; STDOUT ;;; -called host spectest.print(i32:97) => () -called host spectest.print(i32:98) => () -called host spectest.print(i32:99) => () -called host spectest.print(i32:122) => () -called host spectest.print(i32:25185) => () -called host spectest.print(i32:25185) => () -called host spectest.print(i32:25442) => () -called host spectest.print(i32:25699) => () -called host spectest.print(i32:122) => () -called host spectest.print(i32:1684234849) => () -called host spectest.print(i32:1701077858) => () -called host spectest.print(i32:1717920867) => () -called host spectest.print(i32:122) => () -$action_0() => -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -$action_1() => -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -called host spectest.print(i32:0) => () -3/3 tests passed. +called host spectest.print(i32:97) => +called host spectest.print(i32:98) => +called host spectest.print(i32:99) => +called host spectest.print(i32:122) => +called host spectest.print(i32:25185) => +called host spectest.print(i32:25185) => +called host spectest.print(i32:25442) => +called host spectest.print(i32:25699) => +called host spectest.print(i32:122) => +called host spectest.print(i32:1684234849) => +called host spectest.print(i32:1701077858) => +called host spectest.print(i32:1717920867) => +called host spectest.print(i32:122) => +good(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +good(i32:65507) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +called host spectest.print(i32:0) => +5/5 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/float_exprs.txt b/test/spec/float_exprs.txt index 8ea784ad..bdf0262f 100644 --- a/test/spec/float_exprs.txt +++ b/test/spec/float_exprs.txt @@ -1,15 +1,15 @@ ;;; TOOL: run-interp-spec ;;; STDIN_FILE: third_party/testsuite/float_exprs.wast (;; STDOUT ;;; -$action_0() => -$action_1() => -$action_2() => -$action_3() => -$action_8() => -$action_0() => -$action_1() => -$action_2() => -$action_3() => -$action_8() => -694/694 tests passed. +init(i32:0, f32:15.1) => +init(i32:4, f32:15.2) => +init(i32:8, f32:15.3) => +init(i32:12, f32:15.4) => +run(i32:16, f32:3) => +init(i32:0, f64:15.1) => +init(i32:8, f64:15.2) => +init(i32:16, f64:15.3) => +init(i32:24, f64:15.4) => +run(i32:32, f64:3) => +704/704 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/float_memory.txt b/test/spec/float_memory.txt index 204b88af..21deb04b 100644 --- a/test/spec/float_memory.txt +++ b/test/spec/float_memory.txt @@ -1,29 +1,29 @@ ;;; TOOL: run-interp-spec ;;; STDIN_FILE: third_party/testsuite/float_memory.wast (;; STDOUT ;;; -$action_2() => -$action_5() => -$action_8() => -$action_11() => -$action_2() => -$action_5() => -$action_8() => -$action_11() => -$action_2() => -$action_5() => -$action_8() => -$action_11() => -$action_2() => -$action_5() => -$action_8() => -$action_11() => -$action_2() => -$action_5() => -$action_8() => -$action_11() => -$action_2() => -$action_5() => -$action_8() => -$action_11() => -60/60 tests passed. +reset() => +f32.store() => +reset() => +i32.store() => +reset() => +f64.store() => +reset() => +i64.store() => +reset() => +f32.store() => +reset() => +i32.store() => +reset() => +f64.store() => +reset() => +i64.store() => +reset() => +f32.store() => +reset() => +i32.store() => +reset() => +f64.store() => +reset() => +i64.store() => +84/84 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/func_ptrs.txt b/test/spec/func_ptrs.txt index b38faf9b..55248283 100644 --- a/test/spec/func_ptrs.txt +++ b/test/spec/func_ptrs.txt @@ -29,7 +29,7 @@ assert_invalid error: third_party/testsuite/func_ptrs.wast:48:64: function type variable out of range (max 0) ...invalid (module (import "spectest" "print" (func (type 43)))) "unknown type") ^^ -called host spectest.print(i32:83) => () -$action_3() => -25/25 tests passed. +called host spectest.print(i32:83) => +four(i32:83) => +26/26 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/memory_redundancy.txt b/test/spec/memory_redundancy.txt index a33af0d9..527ba1dc 100644 --- a/test/spec/memory_redundancy.txt +++ b/test/spec/memory_redundancy.txt @@ -1,7 +1,7 @@ ;;; TOOL: run-interp-spec ;;; STDIN_FILE: third_party/testsuite/memory_redundancy.wast (;; STDOUT ;;; -$action_1() => -$action_3() => -3/3 tests passed. +zero_everything() => +zero_everything() => +5/5 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/names.txt b/test/spec/names.txt index 157b98fc..46176bce 100644 --- a/test/spec/names.txt +++ b/test/spec/names.txt @@ -1,8 +1,8 @@ ;;; TOOL: run-interp-spec ;;; STDIN_FILE: third_party/testsuite/names.wast (;; STDOUT ;;; -called host spectest.print(i32:42) => () -called host spectest.print(i32:123) => () -$action_0() => -14/14 tests passed. +called host spectest.print(i32:42) => +called host spectest.print(i32:123) => +print32(i32:42, i32:123) => +15/15 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/start.txt b/test/spec/start.txt index bd7fe7c4..9d956525 100644 --- a/test/spec/start.txt +++ b/test/spec/start.txt @@ -13,11 +13,11 @@ assert_invalid error: third_party/testsuite/start.wast:15:5: start function must be nullary (start $main) ^^^^^^^^^^^^^ -$action_1() => -$action_3() => -$action_1() => -$action_3() => -called host spectest.print(i32:1) => () -called host spectest.print(i32:2) => () -6/6 tests passed. +inc() => +inc() => +inc() => +inc() => +called host spectest.print(i32:1) => +called host spectest.print(i32:2) => +10/10 tests passed. ;;; STDOUT ;;) diff --git a/test/utils.py b/test/utils.py index 7dac9aab..254257cd 100644 --- a/test/utils.py +++ b/test/utils.py @@ -18,6 +18,7 @@ from __future__ import print_function import contextlib import os +import json import shutil import signal import subprocess @@ -163,3 +164,9 @@ def Hexdump(data): lines.append(line) return lines + + +def GetModuleFilenamesFromSpecJSON(json_filename): + with open(json_filename) as json_file: + json_data = json.load(json_file) + return [m['filename'] for m in json_data['commands'] if 'filename' in m] |