More dense test output

This commit is contained in:
Sage Vaillancourt 2021-07-04 23:46:59 -04:00
parent 3d48c2eae0
commit 6a2e12ebfe
1 changed files with 10 additions and 10 deletions

View File

@ -4,8 +4,8 @@ VALCOM="valgrind -q --leak-check=full --track-origins=yes"
TOTAL_PASSES=0
TOTAL_FAILS=0
PASSES=0
FAILS=0
FAIL_OUTPUT=""
VALGRIND=0
CURRENT_BLOCK=""
@ -15,26 +15,26 @@ if [ "$1" == "-val" ]; then
fi
endBlock() {
echo "$PASSES tests PASSED"
echo ""
if (($FAILS != 0)); then
echo "$FAILS tests FAILED"
echo -e "$FAIL_OUTPUT"
FAIL_OUTPUT=""
fi
PASSES=0
FAILS=0
echo ""
}
title() {
echo "$1"
echo -n "[$1] "
}
pass() {
((PASSES++))
echo -n "✓"
((TOTAL_PASSES++))
}
fail() {
echo "$1 test FAILED $2"
echo -n "X"
FAIL_OUTPUT="$FAIL_OUTPUT $1 test FAILED $2"
((FAILS++))
((TOTAL_FAILS++))
}
@ -51,14 +51,14 @@ check() {
pass $1
else
fail $1 "$2"
echo " Expected '$3' but received '$output'"
FAIL_OUTPUT="${FAIL_OUTPUT}\n Expected '$3' but received '$output'"
fi
}
echo "STARTING TESTS"
echo ""
title "Plain return tests"
title "Plain returns"
check "PlainRet" "10" "10"
check "StrRetrn" "\"hey\"" "hey"
check "SingleStrRetrn" "'hey'" "hey"