set -e
FAIL=0
+FAILED_TESTS=""
DIR=$(readlink -f $(dirname $0))
if [ "$1" = "-q" ]; then
export MSGLEVEL=2
export MSGLEVEL=2
fi
+if [ -z "$MSGLEVEL" ]; then
+ MSGLEVEL=5
+fi
+
for testcase in $(run-parts --list $DIR | grep '/test-'); do
if [ "$MSGLEVEL" -le 2 ]; then
echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
fi
if ! ${testcase}; then
FAIL=$((FAIL+1))
+ FAILED_TESTS="$FAILED_TESTS $(basename $testcase)"
echo "$(basename $testcase) ... FAIL"
fi
if [ "$MSGLEVEL" -le 2 ]; then
done
echo "failures: $FAIL"
-exit $FAIL
+if [ -n "$FAILED_TESTS" ]; then
+ echo "Failed tests: $FAILED_TESTS";
+fi
+# ensure we don't overflow
+exit $((FAIL <= 255 ? FAIL : 255))