2022-08-16 01:37:04 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-09-24 17:19:48 -07:00
|
|
|
set -e
|
2022-08-16 01:37:04 -07:00
|
|
|
|
2022-09-07 19:21:04 -07:00
|
|
|
scons -j $(nproc)
|
|
|
|
|
2024-03-19 21:12:54 -07:00
|
|
|
examples=(
|
2024-05-16 23:53:40 -07:00
|
|
|
cond donate empty float mutex notify once queue rwlock sem simple sleep tls
|
2024-03-19 21:12:54 -07:00
|
|
|
water/barrier water/cond water/sem cycle/mutex cycle/notify cycle/queue
|
2024-05-16 23:53:40 -07:00
|
|
|
cycle/sem cycle/sleep cycle/yield cxx/cond cxx/mutex cxx/notify cxx/once
|
|
|
|
cxx/queue cxx/rwlock cxx/sem cxx/sleep cxx/water/barrier cxx/water/cond
|
|
|
|
cxx/water/sem signal/mutex-irq signal/sem-irq
|
2024-03-19 21:12:54 -07:00
|
|
|
)
|
|
|
|
|
2024-05-13 00:00:03 -07:00
|
|
|
exitcode=0
|
|
|
|
|
|
|
|
trap 'exitcode=1' ABRT
|
|
|
|
|
|
|
|
script_pid="$$"
|
|
|
|
|
|
|
|
function run_example {
|
|
|
|
trap '' ABRT
|
|
|
|
if ! "build/$1"; then
|
|
|
|
echo "$1" failed
|
|
|
|
kill -ABRT -- "$script_pid"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-03-19 21:12:54 -07:00
|
|
|
for e in "${examples[@]}"; do
|
|
|
|
echo "running $e..."
|
2024-05-13 00:00:03 -07:00
|
|
|
run_example "$e" &
|
2024-03-19 21:12:54 -07:00
|
|
|
done
|
|
|
|
|
|
|
|
wait
|
2024-05-13 00:00:03 -07:00
|
|
|
|
|
|
|
exit "$exitcode"
|