Skip to content

Commit c8c9e66

Browse files
author
jfpoilpret
committed
Add new helper script to check build warnings
1 parent 708cab6 commit c8c9e66

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

make/check-build-warnings

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

0 commit comments

Comments
 (0)