Skip to content

Commit

Permalink
Print better test summary
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyz32 committed Jul 25, 2024
1 parent 9e4b6af commit 2c4ddf7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
{
"label": "deployAndTest",
"type": "shell",
"command": "./deployAndTest.sh"
"command": "./deployAndTest.sh",
"problemMatcher": []
},
{
"label": "deployBuildAllAndTest",
"type": "shell",
"command": "./deployBuildAllAndTest.sh"
"command": "./deployBuildAllAndTest.sh",
"problemMatcher": []
},
{
"label": "deployBuildCamelAndTest",
Expand Down
22 changes: 17 additions & 5 deletions test/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ num_fail=0
num_pass=0
num_error=0

failedTests=""
erroredTests=""
passedTests=""


for test in $TESTS
do
echo "Running test $test..."
Expand All @@ -23,6 +28,7 @@ do
if [[ "0" != "$?" ]]
then
((num_error+=1))
erroredTests="$erroredTests$test"$'\n'" "
fi

echo "Done running test $test. Exit code was $?"
Expand All @@ -47,21 +53,27 @@ do
if [[ "0" == "$result" ]]
then
((num_pass+=1))
passedTests="$passedTests$test"$'\n'" "
else
((num_fail+=1))
failedTests="$failedTests$test"$'\n'" "
fi

echo "Performing test-specific cleanup for test $test..."
gmake -C $test cleanup || echo "no setup needed"
echo "Performing cleanup..."
gmake posttest
echo "=================================="
echo "Results:"
echo " $num_pass passed"
echo " $num_fail failed"
echo " $num_error errored"
done

echo "=================================="
echo "Results:"
echo " $num_pass passed"
echo " $passedTests"
echo " $num_fail failed"
echo " $failedTests"
echo " $num_error errored"
echo " $erroredTests"

if [ $num_fail -ne 0 ] || [ $num_error -ne 0 ]; then
echo "Tests failed."
exit 1
Expand Down

0 comments on commit 2c4ddf7

Please sign in to comment.