Skip to content

Commit

Permalink
support more spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsavola committed Jul 17, 2018
1 parent b769070 commit 0ef87d6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 9 additions & 2 deletions spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ const (
// func Test_binary(t *testing.T) { spec(t, "binary") }
// func Test_call_indirect(t *testing.T) { spec(t, "call_indirect") }
// func Test_comments(t *testing.T) { spec(t, "comments") }
// func Test_custom_section(t *testing.T) { spec(t, "custom_section") }
// func Test_exports(t *testing.T) { spec(t, "exports") }
// func Test_fac(t *testing.T) { spec(t, "fac") }
// func Test_float_exprs(t *testing.T) { spec(t, "float_exprs") }
// func Test_float_literals(t *testing.T) { spec(t, "float_literals") }
// func Test_func(t *testing.T) { spec(t, "func") }
// func Test_func_ptrs(t *testing.T) { spec(t, "func_ptrs") }
// func Test_imports(t *testing.T) { spec(t, "imports") }
Expand All @@ -57,6 +55,7 @@ func Test_break_drop(t *testing.T) { spec(t, "break-drop") }
func Test_call(t *testing.T) { spec(t, "call") }
func Test_const(t *testing.T) { spec(t, "const") }
func Test_conversions(t *testing.T) { spec(t, "conversions") }
func Test_custom_section(t *testing.T) { spec(t, "custom_section") }
func Test_elem(t *testing.T) { spec(t, "elem") }
func Test_endianness(t *testing.T) { spec(t, "endianness") }
func Test_f32(t *testing.T) { spec(t, "f32") }
Expand All @@ -65,6 +64,7 @@ func Test_f32_cmp(t *testing.T) { spec(t, "f32_cmp") }
func Test_f64(t *testing.T) { spec(t, "f64") }
func Test_f64_bitwise(t *testing.T) { spec(t, "f64_bitwise") }
func Test_f64_cmp(t *testing.T) { spec(t, "f64_cmp") }
func Test_float_literals(t *testing.T) { spec(t, "float_literals") }
func Test_float_memory(t *testing.T) { spec(t, "float_memory") }
func Test_float_misc(t *testing.T) { spec(t, "float_misc") }
func Test_forward(t *testing.T) { spec(t, "forward") }
Expand Down Expand Up @@ -164,6 +164,13 @@ func testModule(t *testing.T, data []byte, filename string, quiet bool) []byte {
return data
}

if len(module) > 1 {
if s, ok := module[1].(string); ok && s == "binary" {
t.Logf("module binary not supported")
return data
}
}

module = append([]interface{}{
module[0],
[]interface{}{
Expand Down
2 changes: 1 addition & 1 deletion testdata/wabt
Submodule wabt updated 73 files
+40 −22 src/binary-reader-interp.cc
+30 −19 src/binary-reader-ir.cc
+27 −21 src/binary-reader-logging.cc
+7 −8 src/binary-reader-logging.h
+6 −18 src/binary-reader-nop.h
+22 −13 src/binary-reader-objdump.cc
+11 −8 src/binary-reader-opcnt.cc
+55 −41 src/binary-reader.cc
+6 −8 src/binary-reader.h
+20 −15 src/binary-writer.cc
+19 −12 src/c-writer.cc
+46 −13 src/common.h
+1 −3 src/config.h.in
+1 −0 src/feature.def
+10 −11 src/interp.cc
+3 −3 src/interp.h
+3 −3 src/ir.h
+77 −68 src/type-checker.cc
+29 −17 src/type-checker.h
+44 −26 src/validator.cc
+63 −10 src/wast-parser.cc
+1 −0 src/wast-parser.h
+30 −14 src/wat-writer.cc
+2 −2 test/binary/bad-function-param-type.txt
+2 −2 test/binary/bad-function-result-type.txt
+2 −2 test/binary/bad-simd-type.txt
+35 −0 test/binary/bad-too-many-locals.txt
+2 −2 test/binary/bad-type-form.txt
+93 −0 test/dump/block-multi.txt
+50 −0 test/dump/func-result-multi.txt
+118 −0 test/dump/if-multi.txt
+93 −0 test/dump/if_except-multi.txt
+93 −0 test/dump/loop-multi.txt
+113 −0 test/dump/try-multi.txt
+1 −0 test/help/spectest-interp.txt
+1 −0 test/help/wasm-interp.txt
+1 −0 test/help/wasm-validate.txt
+1 −0 test/help/wasm2wat.txt
+1 −0 test/help/wast2json.txt
+1 −0 test/help/wat-desugar.txt
+1 −0 test/help/wat2wasm.txt
+6 −6 test/interp/basic-tracing.txt
+35 −0 test/interp/block-multi.txt
+48 −0 test/interp/call-multi-result.txt
+28 −0 test/interp/if-multi.txt
+1,756 −1,756 test/interp/logging-all-opcodes.txt
+30 −0 test/interp/loop-multi.txt
+1,760 −1,760 test/interp/tracing-all-opcodes.txt
+1 −1 test/parse/expr/bad-binary-one-expr.txt
+11 −2 test/parse/expr/bad-block-sig-multi.txt
+1 −1 test/parse/expr/bad-compare-one-expr.txt
+14 −2 test/parse/expr/bad-if-sig-multi.txt
+23 −0 test/parse/expr/bad-if_except-sig-multi.txt
+11 −2 test/parse/expr/bad-loop-sig-multi.txt
+31 −0 test/parse/expr/bad-try-sig-multi.txt
+19 −0 test/parse/expr/block-multi.txt
+29 −0 test/parse/expr/if-multi.txt
+44 −0 test/parse/expr/if_except-multi.txt
+20 −0 test/parse/expr/loop-multi.txt
+26 −0 test/parse/expr/try-multi.txt
+6 −0 test/parse/func/result-multi.txt
+3 −0 test/run-roundtrip.py
+1 −1 test/spec/br_table.txt
+3 −3 test/spec/if.txt
+3 −3 test/spec/unreached-invalid.txt
+58 −0 test/typecheck/bad-block-multi-mismatch.txt
+0 −3 test/typecheck/bad-expr-if.txt
+85 −0 test/typecheck/bad-if-multi-mismatch.txt
+58 −0 test/typecheck/bad-loop-multi-mismatch.txt
+42 −0 test/typecheck/br-multi.txt
+50 −0 test/typecheck/brif-multi.txt
+52 −0 test/typecheck/brtable-multi.txt
+1 −1 wasm2c/wasm-rt-impl.c
8 changes: 4 additions & 4 deletions util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func wast2wasm(expString []byte, quiet bool) io.ReadCloser {
}
defer f3.Close()

cmd3 := exec.Command(path.Join(binDir, "wat2wasm"), "-o", f3.Name(), f.Name())
cmd3 := exec.Command(path.Join(binDir, "wat2wasm"), "--no-check", "-o", f3.Name(), f.Name())
cmd3.Stdout = os.Stdout
cmd3.Stderr = os.Stderr
if err := cmd3.Run(); err != nil {
Expand All @@ -48,7 +48,7 @@ func wast2wasm(expString []byte, quiet bool) io.ReadCloser {
panic(err)
}

cmd2 := exec.Command(path.Join(binDir, "wasm2wat"), "-o", "/dev/stdout", f3.Name())
cmd2 := exec.Command(path.Join(binDir, "wasm2wat"), "--no-check", "-o", "/dev/stdout", f3.Name())
cmd2.Stdout = os.Stdout
cmd2.Stderr = os.Stderr
if err := cmd2.Run(); err != nil {
Expand All @@ -58,7 +58,7 @@ func wast2wasm(expString []byte, quiet bool) io.ReadCloser {
}

if dumpWASM {
cmd := exec.Command(path.Join(binDir, "wat2wasm"), "-v", f.Name())
cmd := exec.Command(path.Join(binDir, "wat2wasm"), "--no-check", "-v", f.Name())
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
Expand All @@ -74,7 +74,7 @@ func wast2wasm(expString []byte, quiet bool) io.ReadCloser {
}
os.Remove(f2.Name())

cmd := exec.Command(path.Join(binDir, "wat2wasm"), "--debug-names", "-o", "/dev/stdout", f.Name())
cmd := exec.Command(path.Join(binDir, "wat2wasm"), "--debug-names", "--no-check", "-o", "/dev/stdout", f.Name())
cmd.Stdout = f2
if !quiet {
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit 0ef87d6

Please sign in to comment.