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.
This commit is contained in:
Tobin C. Harding 2023-07-21 11:39:08 +10:00
parent 637d08f1fe
commit 4b9168ca25
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 14 additions and 9 deletions

View File

@ -86,15 +86,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

View File

@ -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