Skip to content

Commit

Permalink
wasm: run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aykevl committed Oct 20, 2018
1 parent 338a9b3 commit d24f685
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ before_install:
- echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-7 main" | sudo tee -a /etc/apt/sources.list
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get install llvm-7-dev clang-7 gcc-arm-none-eabi qemu-system-arm --allow-unauthenticated -y
- sudo apt-get install llvm-7-dev clang-7 lld-7 gcc-arm-none-eabi qemu-system-arm --allow-unauthenticated -y
- sudo ln -s /usr/bin/clang-7 /usr/local/bin/cc # work around missing -no-pie in old GCC version

install:
- go get github.com/aykevl/go-llvm
- go get golang.org/x/tools/go/ssa
- go get github.com/Xe/olin/cmd/cwa

script:
- go install github.com/aykevl/tinygo
Expand All @@ -27,3 +28,4 @@ script:
- tinygo build -o test.nrf.elf -target=nrf52840-mdk examples/blinky1
- tinygo build -o blinky1.stm32.elf -target=bluepill examples/blinky1
- tinygo build -o blinky1.avr.o -target=arduino examples/blinky1 # TODO: avr-as/avr-gcc doesn't work
- tinygo build -o test.wasm.wasm -target=wasm examples/test
9 changes: 8 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ func TestCompiler(t *testing.T) {
})
}

t.Log("running tests on the qemu target...")
t.Log("running tests on the QEMU target...")
for _, path := range matches {
t.Run(path, func(t *testing.T) {
runTest(path, tmpdir, "qemu", t)
})
}

t.Log("running tests on the WebAssembly target...")
for _, path := range matches {
t.Run(path, func(t *testing.T) {
runTest(path, tmpdir, "wasm", t)
})
}
}

func runTest(path, tmpdir string, target string, t *testing.T) {
Expand Down

0 comments on commit d24f685

Please sign in to comment.