#!/usr/bin/env bash # Run cuda-driver unit tests of THIS worktree in WSL (no GPU needed for the window planner / seal tests). # scripts/decode-sm120/test_driver.sh [cargo test filter...] run from Git Bash in the worktree set -euo pipefail root=$(git rev-parse --show-toplevel) tar_win="$root/../wt-sm120-src.tar" git -C "$root" -c core.autocrlf=false ls-files -co --exclude-standard -z | tar --force-local -C "$root" --null -T - -cf "$tar_win" w=$(cygpath -m "$tar_win"); tar_wsl="/mnt/c${w#C:}" wsl -d Ubuntu -e bash -lc " set -e source ~/.cargo/env export PATH=\$HOME/cuda-toolkits/13.2.2/bin:\$HOME/.cargo/bin:/usr/local/bin:/usr/bin:/bin rm -rf ~/sm120-src && mkdir -p ~/sm120-src && tar -xf '$tar_wsl' -C ~/sm120-src cd ~/sm120-src export CARGO_TARGET_DIR=\$HOME/sm120-target nice -n 10 cargo test --locked --release -p leleka-cuda-driver --features 'cuda-driver ${SM120_FEATURES:-}' --lib -- $* > ~/sm120-test.log 2>&1 || true " rm -f "$tar_win" wsl -d Ubuntu -e bash -lc "grep -E '^error|^test result|FAILED|panicked' -A8 ~/sm120-test.log | head -100"