2018-12-15 06:45:03 +00:00
|
|
|
.PHONY: spectests emtests clean build install lint precommit
|
2018-10-23 21:54:07 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
# Generate files
|
|
|
|
generate-spectests:
|
2019-07-06 01:57:30 +00:00
|
|
|
WASMER_RUNTIME_GENERATE_SPECTESTS=1 cargo build -p wasmer-runtime-core --release
|
2018-10-23 21:54:07 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
generate-emtests:
|
2019-07-09 19:07:05 +00:00
|
|
|
WASM_EMSCRIPTEN_GENERATE_EMTESTS=1 cargo build -p wasmer-emscripten-tests --release
|
2018-12-10 03:21:28 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
generate-wasitests:
|
2019-07-09 18:58:03 +00:00
|
|
|
WASM_WASI_GENERATE_WASITESTS=1 cargo build -p wasmer-wasi-tests --release
|
2019-05-17 19:09:31 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
generate: generate-spectests generate-emtests generate-wasitests
|
2018-10-23 21:54:07 +00:00
|
|
|
|
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
# Spectests
|
|
|
|
spectests-singlepass:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test --manifest-path lib/spectests/Cargo.toml --release --features singlepass
|
2018-10-23 21:54:07 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
spectests-cranelift:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test --manifest-path lib/spectests/Cargo.toml --release --features clif
|
2019-01-18 20:20:13 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
spectests-llvm:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test --manifest-path lib/spectests/Cargo.toml --release --features llvm
|
2018-12-15 06:45:03 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
spectests: spectests-singlepass spectests-cranelift spectests-llvm
|
2018-12-15 06:45:03 +00:00
|
|
|
|
2019-04-11 22:00:02 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
# Emscripten tests
|
|
|
|
emtests-singlepass:
|
2019-07-09 19:07:05 +00:00
|
|
|
cargo test --manifest-path lib/emscripten-tests/Cargo.toml --release --features singlepass -- --test-threads=1
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
emtests-cranelift:
|
2019-07-09 19:07:05 +00:00
|
|
|
cargo test --manifest-path lib/emscripten-tests/Cargo.toml --release --features clif -- --test-threads=1
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
emtests-llvm:
|
2019-07-09 19:07:05 +00:00
|
|
|
cargo test --manifest-path lib/emscripten-tests/Cargo.toml --release --features llvm -- --test-threads=1
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
emtests: emtests-singlepass emtests-cranelift emtests-llvm
|
2019-04-11 22:00:02 +00:00
|
|
|
|
2018-11-13 18:28:50 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
# Middleware tests
|
|
|
|
middleware-singlepass:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test --manifest-path lib/middleware-common/Cargo.toml --release --features singlepass
|
2019-03-17 17:13:04 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
middleware-cranelift:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test --manifest-path lib/middleware-common/Cargo.toml --release --features clif
|
2019-03-06 20:44:19 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
middleware-llvm:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test --manifest-path lib/middleware-common/Cargo.toml --release --features llvm
|
2019-04-11 00:15:47 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
middleware: middleware-singlepass middleware-cranelift middleware-llvm
|
2019-03-17 17:13:04 +00:00
|
|
|
|
2019-05-17 19:09:31 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
# Wasitests
|
|
|
|
wasitests-singlepass:
|
2019-07-09 18:58:03 +00:00
|
|
|
cargo test --manifest-path lib/wasi-tests/Cargo.toml --release --features singlepass -- --test-threads=1
|
2019-05-17 20:42:21 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
wasitests-cranelift:
|
2019-07-09 18:58:03 +00:00
|
|
|
cargo test --manifest-path lib/wasi-tests/Cargo.toml --release --features clif -- --test-threads=1
|
2019-04-06 17:29:15 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
wasitests-llvm:
|
2019-07-09 18:58:03 +00:00
|
|
|
cargo test --manifest-path lib/wasi-tests/Cargo.toml --release --features llvm -- --test-threads=1
|
2019-04-06 17:29:15 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
wasitests: wasitests-singlepass wasitests-cranelift wasitests-llvm
|
|
|
|
|
|
|
|
|
|
|
|
# Backends
|
|
|
|
singlepass: spectests-singlepass emtests-singlepass middleware-singlepass wasitests-singlepass
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test -p wasmer-singlepass-backend --release
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
cranelift: spectests-cranelift emtests-cranelift middleware-cranelift wasitests-cranelift
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test -p wasmer-clif-backend --release
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
llvm: spectests-llvm emtests-llvm middleware-llvm wasitests-llvm
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo test -p wasmer-llvm-backend --release
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
# All tests
|
2019-07-06 02:55:03 +00:00
|
|
|
capi:
|
|
|
|
cargo build --release
|
|
|
|
cargo build -p wasmer-runtime-c-api --release
|
|
|
|
cargo test -p wasmer-runtime-c-api --release
|
|
|
|
|
|
|
|
test-rest: capi
|
2019-07-09 19:07:05 +00:00
|
|
|
cargo test --release --all --exclude wasmer-runtime-c-api --exclude wasmer-emscripten --exclude wasmer-spectests --exclude wasmer-wasi --exclude wasmer-middleware-common --exclude wasmer-singlepass-backend --exclude wasmer-clif-backend --exclude wasmer-llvm-backend --exclude wasmer-wasi-tests --exclude wasmer-emscripten-tests
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
circleci-clean:
|
|
|
|
@if [ ! -z "${CIRCLE_JOB}" ]; then rm -f /home/circleci/project/target/debug/deps/libcranelift_wasm* && rm -f /Users/distiller/project/target/debug/deps/libcranelift_wasm*; fi;
|
|
|
|
|
|
|
|
test: spectests emtests middleware wasitests circleci-clean test-rest
|
|
|
|
|
|
|
|
|
|
|
|
# Integration tests
|
2019-07-06 03:38:19 +00:00
|
|
|
integration-tests: release-fast
|
2019-07-06 01:36:34 +00:00
|
|
|
echo "Running Integration Tests"
|
|
|
|
./integration_tests/lua/test.sh
|
|
|
|
./integration_tests/nginx/test.sh
|
|
|
|
./integration_tests/cowsay/test.sh
|
|
|
|
|
|
|
|
|
|
|
|
# Utils
|
|
|
|
lint:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo fmt --all -- --check
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
precommit: lint test
|
|
|
|
|
2019-07-07 05:05:45 +00:00
|
|
|
debug:
|
2019-07-08 02:35:28 +00:00
|
|
|
cargo build --release --features backend:singlepass,debug,trace
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
install:
|
2019-07-06 02:55:03 +00:00
|
|
|
cargo install --path .
|
2019-04-06 17:29:15 +00:00
|
|
|
|
2018-11-13 18:28:50 +00:00
|
|
|
release:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo build --release --features backend:singlepass,backend:llvm,loader:kernel
|
2019-07-06 01:36:34 +00:00
|
|
|
|
|
|
|
# Only one backend (cranelift)
|
|
|
|
release-fast:
|
2018-11-13 18:28:50 +00:00
|
|
|
# If you are in OS-X, you will need mingw-w64 for cross compiling to windows
|
|
|
|
# brew install mingw-w64
|
2019-07-08 18:30:04 +00:00
|
|
|
cargo build --release
|
|
|
|
|
|
|
|
release-singlepass:
|
2019-07-08 02:35:28 +00:00
|
|
|
cargo build --release --features backend:singlepass
|
2019-07-06 01:36:34 +00:00
|
|
|
|
2019-07-08 18:30:04 +00:00
|
|
|
release-llvm:
|
|
|
|
cargo build --release --features backend:llvm
|
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
bench:
|
2019-07-06 01:57:30 +00:00
|
|
|
cargo bench --all
|
2018-11-13 18:28:50 +00:00
|
|
|
|
2019-04-11 22:33:02 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
# Build utils
|
|
|
|
build-install:
|
|
|
|
mkdir -p ./install/bin
|
|
|
|
cp ./wapm-cli/target/release/wapm ./install/bin/
|
|
|
|
cp ./target/release/wasmer ./install/bin/
|
|
|
|
tar -C ./install -zcvf wasmer.tar.gz bin/wapm bin/wasmer
|
2018-11-26 19:47:33 +00:00
|
|
|
|
2019-07-06 01:36:34 +00:00
|
|
|
# For installing the contents locally
|
|
|
|
do-install:
|
|
|
|
tar -C ~/.wasmer -zxvf wasmer.tar.gz
|
2019-05-05 19:17:10 +00:00
|
|
|
|
2018-11-13 18:28:50 +00:00
|
|
|
publish-release:
|
|
|
|
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
|
2019-06-17 20:25:20 +00:00
|
|
|
|
|
|
|
# cargo install cargo-deps
|
|
|
|
# must install graphviz for `dot`
|
|
|
|
dep-graph:
|
2019-07-09 19:07:05 +00:00
|
|
|
cargo deps --optional-deps --filter wasmer-wasi wasmer-wasi-tests wasmer-kernel-loader wasmer-dev-utils wasmer-llvm-backend wasmer-emscripten wasmer-emscripten-tests wasmer-runtime-core wasmer-runtime wasmer-middleware-common wasmer-singlepass-backend wasmer-clif-backend wasmer --manifest-path Cargo.toml | dot -Tpng > wasmer_depgraph.png
|