test: add WebAssembly tests
Этот коммит содержится в:
родитель
41e093d7bb
коммит
b594f212fb
2 изменённых файлов: 22 добавлений и 0 удалений
|
@ -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 }}
|
||||
|
|
11
main_test.go
11
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)
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче