File: test-wasm

package info (click to toggle)
rustc-web 1.85.0%2Bdfsg3-1~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 1,759,988 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,056; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (23 lines) | stat: -rwxr-xr-x 698 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

if [ $# = 0 ]; then
  echo "Usage: ./test-wasm <cargo command>" >&2
  echo "Example: ./test-wasm cargo test --lib -- --nocapture" >&2
  exit 1
fi
if ! command -V rustup &> /dev/null; then
  echo 'please install rustup' >&2
  exit 1
fi
if ! rustup target list | grep installed | grep -q wasm32-wasip1; then
  echo 'please run `rustup target add wasm32-wasip1` first' >&2
  exit 1
fi

export WASMTIME_BACKTRACE_DETAILS=1
export CARGO_BUILD_TARGET=wasm32-wasip1
# Not sure exactly why this is needed, but without it,
# `insta` tries to run `cargo`, and wasip1 doesn't like that.
export INSTA_WORKSPACE_ROOT="$PWD"
export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime run -S inherit-env"
"$@"