rt/test.bash

34 lines
711 B
Bash
Raw Normal View History

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)
2022-09-24 17:19:48 -07:00
trap 'if [ "$?" != "0" ]; then echo "test failed!"; fi' EXIT
2024-03-19 21:12:54 -07:00
examples=(
2024-04-29 09:39:41 -07:00
donate empty float mutex notify once queue rwlock sem simple
2024-03-19 21:12:54 -07:00
water/barrier water/cond water/sem cycle/mutex cycle/notify cycle/queue
cycle/sem cycle/sleep cycle/yield cxx/mutex cxx/notify cxx/once cxx/queue
cxx/rwlock cxx/sem cxx/water/barrier cxx/water/cond cxx/water/sem
)
for e in "${examples[@]}"; do
echo "running $e..."
"build/$e" &
done
wait
# run the sleep examples one-by-one as they are performance-sensitive
# (threads getting delayed will fail an assert)
sleep_examples=(
sleep cxx/sleep
)
for e in "${sleep_examples[@]}"; do
echo "running $e..."
"build/$e"
done