#!/usr/bin/env bash # SPDX-License-Identifier: MIT # The crate's own Rust tests (the rewind window's), natively, against the same base board as # the build (BOARD, default ../pcengine-rust-fast, staged as scripts/build-wasm.sh does). # Usage: scripts/test-native.sh set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) cd "$ROOT" # The rust-toolchain.toml toolchain's own cargo and rustc, as scripts/build-wasm.sh explains. TOOLCHAIN=${TOOLCHAIN:-"$HOME/.rustup/toolchains/1.93.1-x86_64-unknown-linux-gnu"} if [ -z "${CARGO:-}" ] && [ -x "$TOOLCHAIN/bin/cargo" ]; then CARGO="$TOOLCHAIN/bin/cargo" export RUSTC="$TOOLCHAIN/bin/rustc" fi CARGO=${CARGO:-cargo} scripts/stage-board.sh "${BOARD:-../pcengine-rust-fast}" $CARGO test --release -q --lib --config 'paths=["target/board"]'