#!/bin/bash
# W2 #238 gate — Windows arm. Runs INSIDE the gate worktree (cd by caller-created path).
# Touched: spt-proto (shortform), spt-store (iolog), spt (delivery/ioevents + midturn_span_e2e),
# spt-daemon (iobus/shellchan), docs sweep, registry.
cd "$(dirname "$0")" || exit 9
run() { name=$1; shift; echo "=== $name: $*" >> GATE_driver.log; "$@" > "GATE_${name}.raw" 2>&1; echo $? > "GATE_${name}.exit"; }
git log --oneline -1 >> GATE_driver.log
run claim cargo run -p xtask -- pool-claim --pool target --label gate-w2-238
run fixtures cargo build -p mock-adapter --bins
run treqs traceable-reqs check
run clippy cargo clippy --workspace --all-targets -- -D warnings
run units cargo nextest run --workspace --lib --no-fail-fast
run nextest_proto cargo nextest run -p spt-proto
run nextest_store cargo nextest run -p spt-store
run midturn_e2e cargo nextest run -p spt --test midturn_span_e2e --test-threads 1
run neighbor_e2e cargo nextest run -p spt --test io_events_poll_e2e --test-threads 1
run xtaskcheck cargo run -p xtask -- check
echo DONE >> GATE_driver.log
