3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-20 11:50:26 +00:00
sby/tests/intertask/cancelledby.sh
Krystine Sherwin 360f1b03a3
tests/intertask: Use bash script
Somewhat hacky use of the automatic task collection splitting tasks into separate make targets.
2025-07-09 10:04:37 +12:00

23 lines
1.2 KiB
Bash

#!/bin/bash
set -e
if [[ $TASK == a ]]; then
# different process, no cancellations
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE a
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE b
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE c
test -e ${WORKDIR}_a/PASS -a -e ${WORKDIR}_b/FAIL -a -e ${WORKDIR}_c/FAIL
elif [[ $TASK == b ]]; then
# same process, a cancels c cancels b
# use statusdb so that the different taskloops from using --sequential doesn't matter
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE --statusreset || true
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE a c b --sequential --statuscancels
test -e ${WORKDIR}_a/PASS -a -e ${WORKDIR}_b/CANCELLED -a -e ${WORKDIR}_c/CANCELLED
else
# different process, b cancels a, c completes before a
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE --statusreset || true
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE b --statuscancels
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE c --statuscancels
python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE a --statuscancels
echo test -e ${WORKDIR}_a/CANCELLED -a -e ${WORKDIR}_b/FAIL -a -e ${WORKDIR}_c/FAIL
fi