diff --git a/.circleci/config.yml b/.circleci/config.yml index 40357ad8..c681cd8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,7 @@ commands: llvm<>-dev \ clang<> \ libclang<>-dev \ + lld<> \ 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 }} diff --git a/main_test.go b/main_test.go index 62383407..1eb6199d 100644 --- a/main_test.go +++ b/main_test.go @@ -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)