Skip to content

Commit

Permalink
Run WASM tests from test wrapper script
Browse files Browse the repository at this point in the history
The `wasm-pack` command does not honour `cargo` flags passed to it so we
cannot use `--locked` and test against pre-made lock files. Instead just
run the WASM test from the test script wrapper.
  • Loading branch information
tcharding committed Aug 8, 2023
1 parent 4597309 commit 75ca130
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
9 changes: 0 additions & 9 deletions contrib/_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ if [ "$DO_DOCS" = true ]; then
RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features
fi

# Webassembly stuff
if [ "$DO_WASM" = true ]; then
clang --version
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml
CC=clang wasm-pack build
CC=clang wasm-pack test --node
fi

# Address Sanitizer
if [ "$DO_ASAN" = true ]; then
clang --version
Expand Down
14 changes: 14 additions & 0 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@ set -ex

REPO_DIR=$(git rev-parse --show-toplevel)

# Webassembly stuff
#
# The wasm-pack command does not correctly pass args to cargo so we cannot use --locked and test
# with per-commited lockfiles (recent/minimal). Just run the WASM tests from here instead.
if [ "$DO_WASM" = true ]; then
clang --version
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml
CC=clang wasm-pack build
CC=clang wasm-pack test --node

exit 0
fi

$REPO_DIR/contrib/_test.sh

0 comments on commit 75ca130

Please sign in to comment.