@@ -181,13 +181,35 @@ function cmd_itest() {
181
181
}
182
182
183
183
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.
185
198
CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS=" -C link-args=-pthread \
186
199
-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 \
189
202
--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
191
213
}
192
214
193
215
function cmd_doc() {
0 commit comments