Skip to content

Commit 4b9168c

Browse files
committed
Run WASM tests from test wrapper script
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.
1 parent 637d08f commit 4b9168c

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

contrib/_test.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ if [ "$DO_DOCS" = true ]; then
8686
RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features
8787
fi
8888

89-
# Webassembly stuff
90-
if [ "$DO_WASM" = true ]; then
91-
clang --version
92-
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack
93-
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml
94-
CC=clang wasm-pack build
95-
CC=clang wasm-pack test --node
96-
fi
97-
9889
# Address Sanitizer
9990
if [ "$DO_ASAN" = true ]; then
10091
clang --version

contrib/test.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,18 @@ set -ex
44

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

7+
# Webassembly stuff
8+
#
9+
# The wasm-pack command does not correctly pass args to cargo so we cannot use --locked and test
10+
# with per-commited lockfiles (recent/minimal). Just run the WASM tests from here instead.
11+
if [ "$DO_WASM" = true ]; then
12+
clang --version
13+
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack
14+
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml
15+
CC=clang wasm-pack build
16+
CC=clang wasm-pack test --node
17+
18+
exit 0
19+
fi
20+
721
$REPO_DIR/contrib/_test.sh

0 commit comments

Comments
 (0)