1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-19 04:41:44 +02:00

Modify build script for use with Travis CI

- Exit 255 if interrupted
- Exit non-zero if any errors occur (returns the number of failures)
- Fix: second machine name not passed
This commit is contained in:
odaki
2020-03-22 21:10:52 +09:00
parent 330ea2ad7e
commit eb2f514f69

View File

@@ -4,7 +4,7 @@
# for every machine configuration in the Machines/ directory.
# It is useful for automated testing.
trap "echo; exit" SIGINT
trap "echo; exit 255" SIGINT
# With -v, show all output. Otherwise, show just the result
if [ "$1" = "-v" ]; then
@@ -12,18 +12,29 @@ if [ "$1" = "-v" ]; then
else
FILTER="grep error\|Took"
fi
set -o pipefail
NUM_ERRORS=0
BuildMachine () {
basename=$1
addname=$2
BF="-DMACHINE_FILENAME=$basename"
BF="\"-DMACHINE_FILENAME=$basename\""
displayname=$basename
if [ "$addname" != "" ]
then
BF="$BF -DMACHINE_FILENAME2=$addname"
BF="$BF \"-DMACHINE_FILENAME2=$addname\""
displayname="$basename + $addname"
fi
echo "Building machine $displayname"
PLATFORMIO_BUILD_FLAGS=\'$BF\' platformio run 2>&1 | $FILTER
PLATFORMIO_BUILD_FLAGS=$BF platformio run 2>&1 | $FILTER
local re=$?
# check result
if [ $re -ne 0 ]; then
echo "Failed to build machine $displayname"
echo
NUM_ERRORS=$(( NUM_ERRORS + 1 ))
return $re
fi
echo
}
@@ -40,3 +51,5 @@ do
adder=`basename $file`
BuildMachine $base $adder
done
exit $NUM_ERRORS