Skip to content
Permalink
Browse files

test: add WebAssembly tests

  • Loading branch information...
aykevl authored and deadprogram committed Jan 21, 2019
1 parent 41e093d commit b594f212fb1d9e86397fcceee48302fcb60ab6b5
Showing with 22 additions and 0 deletions.
  1. +11 −0 .circleci/config.yml
  2. +11 −0 main_test.go
@@ -23,6 +23,7 @@ commands:
llvm<<parameters.llvm>>-dev \
clang<<parameters.llvm>> \
libclang<<parameters.llvm>>-dev \
lld<<parameters.llvm>> \
gcc-arm-linux-gnueabihf \
binutils-arm-none-eabi \
libc6-dev-armel-cross \
@@ -32,6 +33,15 @@ commands:
qemu-user \
gcc-avr \
avr-libc
install-node:
steps:
- run:
name: "Install node.js"
command: |
wget https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.xz
sudo tar -C /usr/local -xf node-v10.15.1-linux-x64.tar.xz
sudo ln -s /usr/local/node-v10.15.1-linux-x64/bin/node /usr/bin/node
rm node-v10.15.1-linux-x64.tar.xz
dep:
steps:
- run:
@@ -70,6 +80,7 @@ jobs:
- submodules
- apt-dependencies:
llvm: "-7"
- install-node
- restore_cache:
keys:
- go-cache-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
@@ -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)

0 comments on commit b594f21

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.