mirror of
https://github.com/correl/elm.git
synced 2024-11-15 19:19:31 +00:00
Collect exercise failures rather than exiting early.
This commit is contained in:
parent
a082e0ffd9
commit
36719edd91
1 changed files with 13 additions and 6 deletions
19
bin/build.sh
19
bin/build.sh
|
@ -1,3 +1,6 @@
|
||||||
|
declare -i TEST_RESULT=0
|
||||||
|
FAILED_EXERCISES=''
|
||||||
|
|
||||||
for example_file in exercises/**/*.example
|
for example_file in exercises/**/*.example
|
||||||
do
|
do
|
||||||
exercise_dir=$(dirname $example_file)
|
exercise_dir=$(dirname $example_file)
|
||||||
|
@ -7,12 +10,16 @@ do
|
||||||
echo '-------------------------------------------------------'
|
echo '-------------------------------------------------------'
|
||||||
echo "Testing $exercise"
|
echo "Testing $exercise"
|
||||||
elm-test $exercise_dir/*Tests.elm
|
elm-test $exercise_dir/*Tests.elm
|
||||||
TEST_RESULT=$?
|
if [ $? -ne 0 ]; then
|
||||||
|
TEST_RESULT=1
|
||||||
|
FAILED_EXERCISES+="$exercise\n"
|
||||||
|
fi
|
||||||
mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.example"
|
mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.example"
|
||||||
mv "$exercise_dir/$exercise.impl" "$exercise_dir/$exercise.elm"
|
mv "$exercise_dir/$exercise.impl" "$exercise_dir/$exercise.elm"
|
||||||
|
|
||||||
if [ $TEST_RESULT -ne 0 ]; then
|
|
||||||
echo "$exercise failed";
|
|
||||||
exit $TEST_RESULT;
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ $TEST_RESULT -ne 0 ]; then
|
||||||
|
echo "The following exercises failed"
|
||||||
|
printf $FAILED_EXERCISES
|
||||||
|
exit $TEST_RESULT
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue