test: make run.sh fail if tests fail
Adjust `tests/run.sh` to return a non-zero exit code if any of the tests
perform failed.
@@ -40,12 +40,11 @@ while read -d $'\0' SRCFILE; do
done < <(grep -o -E '@elab\s+.*' $SRCFILE | cut -f 2 -d " ")
done < <(find $TESTS_DIR -name "*.sv" -print0)
-if [[ NUM_FAIL > 0 ]]; then
echo
+if [[ NUM_FAIL > 0 ]]; then
echo " ${CNAME}result: ${CFAIL}$NUM_FAIL/$((NUM_FAIL+NUM_PASS)) failed${CRST}"
- echo
else
- echo
echo " ${CNAME}result: ${CPASS}$NUM_PASS passed${CRST}"
- echo
fi
+echo
+[[ NUM_FAIL == 0 ]] # return non-zero exit code if anything failed
