]> granicus.if.org Git - esp-idf/commitdiff
CI build_examples: Don't stop on first failed example, print failure summary
authorAngus Gratton <angus@espressif.com>
Fri, 30 Dec 2016 05:13:07 +0000 (16:13 +1100)
committerAngus Gratton <angus@espressif.com>
Fri, 30 Dec 2016 06:21:16 +0000 (17:21 +1100)
make/build_examples.sh

index dc10d95ab2975b5425ecd5adf9ac2cb5b9928212..ab5920879522d32434ea89b6ef47c1eab5ebcd27 100755 (executable)
 
 EXAMPLE_NUM=1
 RESULT=0
+FAILED_EXAMPLES=""
 
 RESULT_WARNINGS=22  # magic number result code for "warnings found"
 
-set -e
-
 for example in ${IDF_PATH}/examples/*; do
     [ -f ${example}/Makefile ] || continue
     echo "Building ${example} as ${EXAMPLE_NUM}..."
@@ -34,13 +33,13 @@ for example in ${IDF_PATH}/examples/*; do
        set -e
        make clean defconfig
        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
     EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
 
-    if [ $RESULT -eq 0 ] && grep -q ": warning:" $BUILDLOG; then
-        echo "Build will fail, due to warnings in this example"
-        RESULT=$RESULT_WARNINGS
+    if grep -q ": warning:" $BUILDLOG; then
+        [ $RESULT -eq 0 ] && RESULT=$RESULT_WARNINGS
+        FAILED_EXAMPLES+=" ${example} (warnings)"
     fi
 
     rm -f $BUILDLOG
@@ -50,5 +49,7 @@ if [ $RESULT -eq $RESULT_WARNINGS ]; then
     echo "Build would have passed, except for warnings."
 fi
 
+[ $RESULT -eq 0 ] || echo "Failed examples: $FAILED_EXAMPLES"
+
 exit $RESULT