]> granicus.if.org Git - esp-idf/commitdiff
CI build_examples: Correctly detect example build failures
authorAngus Gratton <angus@espressif.com>
Fri, 30 Dec 2016 04:20:49 +0000 (15:20 +1100)
committerAngus Gratton <angus@espressif.com>
Fri, 30 Dec 2016 05:52:58 +0000 (16:52 +1100)
"pipefail" regression when fail-on-warnings was added...

make/build_examples.sh

index f1b37b7b4bf76048b332ee15ea1ec8a04cb516c4..dc10d95ab2975b5425ecd5adf9ac2cb5b9928212 100755 (executable)
@@ -30,10 +30,11 @@ for example in ${IDF_PATH}/examples/*; do
    # build non-verbose first
    BUILDLOG=$(mktemp -t examplebuild.XXXX.log)
    (
+       set -o pipefail  # so result of make all isn't lost when piping to tee
        set -e
        make clean defconfig
-       make all 2>&1 | tee $BUILDLOG
-    ) || (RESULT=$?; make V=1) # only build verbose if there's an error
+       make $* all 2>&1 | tee $BUILDLOG
+    ) || { RESULT=$?; make V=1; } # only build verbose if there's an error
     popd
     EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))