-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcheck-build-warnings
executable file
·44 lines (40 loc) · 1.05 KB
/
check-build-warnings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#
# This script helps checking all builds of a release even in case of warnings:
# 0. Clean all code for all targets
# 1. Build all examples for all targets
# 2. Gather make output and prepare new code size sheet for all targets
CURDIR=`pwd`
SCRIPT=$(readlink -f "$0")
MAKEDIR=$(dirname "$SCRIPT")
BASEDIR=$MAKEDIR/..
DOCDIR=$BASEDIR/basedoc
echo "Clean up all generated code"
cd $BASEDIR
make clean-all >/dev/null 2>&1
make clean-examples-all >/dev/null 2>&1
echo "Build all examples for all targets"
export TARGETS="UNO LEONARDO MEGA ATtiny84 ATtiny85"
for TARGET in $TARGETS
do
echo "Target: $TARGET"
make CONF=$TARGET examples 2>errors | $MAKEDIR/stats.py >newsizes-$TARGET
grep "Error" errors
# check if error found, then abort
if [ $? -ne 1 ]; then
echo "Error occurred, aborting."
exit 1
fi
grep "warning" errors
# check if warning found, then abort
if [ $? -ne 1 ]; then
echo "Warning occurred, aborting."
exit 1
fi
rm -f errors
done
echo "Remove intermediate result files"
for TARGET in $TARGETS
do
rm -f newsizes-$TARGET
done