Skip to content

Commit

Permalink
Merge pull request #34 from yav/main
Browse files Browse the repository at this point in the history
Show failed tests and consider non-0 exit codes as failure.
  • Loading branch information
cp526 authored Jul 19, 2024
2 parents 022500f + 2136949 commit d8b8d15
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fi

good=0
bad=0
declare -a bad_tests

for file in $SCRIPT_DIR/src/examples/*c;
do
Expand All @@ -20,17 +21,19 @@ do
retval=$?
if [[ $file == *.broken.c ]]
then
if [[ $retval -eq 1 ]];
if [[ $retval -ne 0 ]];
then
good=$(($good+1))
else
bad_tests[$bad]=$file
bad=$(($bad+1))
fi
else
if [[ $retval -eq 0 ]];
then
good=$(($good+1))
else
bad_tests[$bad]=$file
bad=$(($bad+1))
fi
fi
Expand All @@ -45,6 +48,10 @@ if [[ "$bad" = 0 ]]
then
exit 0
else
echo "Failed tests:"
for file in ${bad_tests[@]}; do
echo $file
done
exit 1
fi

0 comments on commit d8b8d15

Please sign in to comment.