test: add WebAssembly tests

This commit is contained in:
Ayke van Laethem
2019-01-21 14:54:08 +01:00
committed by Ron Evans
parent 41e093d7bb
commit b594f212fb
2 changed files with 22 additions and 0 deletions
+11
View File
@@ -82,6 +82,16 @@ func TestCompiler(t *testing.T) {
})
}
}
t.Log("running tests for WebAssembly...")
for _, path := range matches {
if path == "testdata/gc.go" {
continue // known to fail
}
t.Run(path, func(t *testing.T) {
runTest(path, tmpdir, "wasm", t)
})
}
}
func runTest(path, tmpdir string, target string, t *testing.T) {
@@ -106,6 +116,7 @@ func runTest(path, tmpdir string, target string, t *testing.T) {
dumpSSA: false,
debug: false,
printSizes: "",
wasmAbi: "js",
}
binary := filepath.Join(tmpdir, "test")
err = Build("./"+path, binary, target, config)