rt/rust/test.bash

37 lines
554 B
Bash
Raw Permalink Normal View History

#!/bin/bash
set -e
cargo +nightly fmt --check
2024-05-28 02:56:28 -07:00
cargo +nightly clippy --all-targets
cargo test
cargo build --release --examples
2024-03-28 22:55:48 -07:00
examples=(
cond donate empty float mutex notify once queue rwlock sem simple sleep
water-barrier water-condvar water-sem
2024-03-28 22:55:48 -07:00
)
exitcode=0
trap 'exitcode=1' ABRT
script_pid="$$"
function run_example {
trap '' ABRT
if ! "target/release/examples/$1"; then
echo "$1" failed
kill -ABRT -- "$script_pid"
fi
}
for e in "${examples[@]}"; do
echo "running $e..."
run_example "$e" &
done
2024-03-19 21:12:54 -07:00
wait
exit "$exitcode"