Skip to content

Commit 730bf2a

Browse files
committed
add non-threaded tests
1 parent eeca2ae commit 730bf2a

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

check.sh

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,35 @@ function cmd_itest() {
181181
}
182182

183183
function cmd_testweb() {
184-
# For the flag: https://github.com/rust-lang/cargo/issues/7471
184+
# Add more debug symbols to build
185+
common_flags="-C link-args=-g"
186+
187+
# Avoid problems with emcc potentially writing to read-only dir
188+
cache_dir="target/emscripten_cache"
189+
mkdir -p "${cache_dir}"
190+
191+
echo "==============================="
192+
echo "Initiating threaded Wasm tests."
193+
echo "==============================="
194+
195+
# For the runner env var: https://github.com/rust-lang/cargo/issues/7471
196+
# More memory (256 MiB) is needed for the parallel godot-cell tests which
197+
# spawn 70 threads each.
185198
CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS="-C link-args=-pthread \
186199
-C target-feature=+atomics \
187-
-C link-args=-g \
188-
-C link-args=-sINITIAL_MEMORY=268435456" EM_CACHE=$(mktemp -d) run cargo +nightly test \
200+
-C link-args=-sINITIAL_MEMORY=268435456 \
201+
${common_flags}" EM_CACHE="${cache_dir}" run cargo +nightly test \
189202
--features godot/experimental-wasm,godot/lazy-function-tables \
190-
-Zbuild-std --target wasm32-unknown-emscripten -- --nocapture
203+
-Zbuild-std --target wasm32-unknown-emscripten
204+
205+
echo "==================================="
206+
echo "Initiating non-threaded Wasm tests."
207+
echo "==================================="
208+
209+
CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS="${common_flags}" \
210+
EM_CACHE="${cache_dir}" run cargo +nightly test \
211+
--features godot/experimental-wasm-nothreads,godot/experimental-wasm,godot/lazy-function-tables \
212+
-Zbuild-std --target wasm32-unknown-emscripten
191213
}
192214

193215
function cmd_doc() {

0 commit comments

Comments
 (0)