Test the capi with multiple backends

This commit is contained in:
Syrus 2019-12-12 16:38:58 -08:00
parent ba29483260
commit 39f5a79254
3 changed files with 32 additions and 10 deletions

View File

@ -102,12 +102,34 @@ llvm: spectests-llvm emtests-llvm wasitests-llvm
# All tests
capi:
cargo build --release --features backend-cranelift
cargo build -p wasmer-runtime-c-api --release
capi-singlepass:
cargo build --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features singlepass-backend,wasi
test-capi: capi
cargo test -p wasmer-runtime-c-api --release
capi-cranelift:
cargo build --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features cranelift-backend,wasi
capi-llvm:
cargo build --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features llvm-backend,wasi
# We use cranelift as the default backend for the capi for now
capi: capi-cranelift
test-capi-singlepass: capi-singlepass
cargo test --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features singlepass-backend,wasi
test-capi-cranelift: capi-cranelift
cargo test --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features cranelift-backend,wasi
test-capi-llvm: capi-llvm
cargo test --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features llvm-backend,wasi
test-capi: test-capi-singlepass test-capi-cranelift test-capi-llvm
capi-test: test-capi

View File

@ -187,23 +187,23 @@ jobs:
mkdir -p artifacts
displayName: Create Artifacts Dir
- bash: |
make capi
make test-capi
displayName: Test c-api
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: |
make capi
cp target/release/libwasmer_runtime_c_api.so ./artifacts
find target/release/build -name 'wasmer.h*' -exec cp {} ./artifacts ';'
displayName: Build c-api (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
make capi
make test-capi
install_name_tool -id "@rpath/libwasmer_runtime_c_api.dylib" target/release/libwasmer_runtime_c_api.dylib
cp target/release/libwasmer_runtime_c_api.dylib ./artifacts
displayName: Build c-api (Darwin)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- bash: |
make capi
# Tests are failing on Windows, comment for now
# make test-capi
cp target/release/wasmer_runtime_c_api.dll ./artifacts
displayName: Build c-api (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

View File

@ -35,9 +35,9 @@ optional = true
[features]
default = ["cranelift-backend", "wasi"]
debug = ["wasmer-runtime/debug"]
singlepass-backend = ["wasmer-runtime/singlepass", "wasmer-runtime/default-backend-singlepass"]
cranelift-backend = ["wasmer-runtime/cranelift", "wasmer-runtime/default-backend-cranelift"]
llvm-backend = ["wasmer-runtime/llvm", "wasmer-runtime/default-backend-llvm"]
singlepass-backend = ["wasmer-runtime/singlepass", "wasmer-runtime/default-backend-singlepass"]
wasi = ["wasmer-wasi"]
[build-dependencies]