mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
CI build_examples: Don't stop on first failed example, print failure summary
This commit is contained in:
parent
eb8324e2c2
commit
6b87419d42
@ -11,11 +11,10 @@
|
|||||||
|
|
||||||
EXAMPLE_NUM=1
|
EXAMPLE_NUM=1
|
||||||
RESULT=0
|
RESULT=0
|
||||||
|
FAILED_EXAMPLES=""
|
||||||
|
|
||||||
RESULT_WARNINGS=22 # magic number result code for "warnings found"
|
RESULT_WARNINGS=22 # magic number result code for "warnings found"
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
for example in ${IDF_PATH}/examples/*; do
|
for example in ${IDF_PATH}/examples/*; do
|
||||||
[ -f ${example}/Makefile ] || continue
|
[ -f ${example}/Makefile ] || continue
|
||||||
echo "Building ${example} as ${EXAMPLE_NUM}..."
|
echo "Building ${example} as ${EXAMPLE_NUM}..."
|
||||||
@ -34,13 +33,13 @@ for example in ${IDF_PATH}/examples/*; do
|
|||||||
set -e
|
set -e
|
||||||
make clean defconfig
|
make clean defconfig
|
||||||
make $* all 2>&1 | tee $BUILDLOG
|
make $* all 2>&1 | tee $BUILDLOG
|
||||||
) || { RESULT=$?; make V=1; } # only build verbose if there's an error
|
) || { RESULT=$?; FAILED_EXAMPLES+=" ${example}"; make V=1; } # only build verbose if there's an error
|
||||||
popd
|
popd
|
||||||
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
|
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
|
||||||
|
|
||||||
if [ $RESULT -eq 0 ] && grep -q ": warning:" $BUILDLOG; then
|
if grep -q ": warning:" $BUILDLOG; then
|
||||||
echo "Build will fail, due to warnings in this example"
|
[ $RESULT -eq 0 ] && RESULT=$RESULT_WARNINGS
|
||||||
RESULT=$RESULT_WARNINGS
|
FAILED_EXAMPLES+=" ${example} (warnings)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f $BUILDLOG
|
rm -f $BUILDLOG
|
||||||
@ -50,5 +49,7 @@ if [ $RESULT -eq $RESULT_WARNINGS ]; then
|
|||||||
echo "Build would have passed, except for warnings."
|
echo "Build would have passed, except for warnings."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ $RESULT -eq 0 ] || echo "Failed examples: $FAILED_EXAMPLES"
|
||||||
|
|
||||||
exit $RESULT
|
exit $RESULT
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user