]> granicus.if.org Git - esp-idf/commitdiff
build: Fix test for the first time 'make clean' and error handling in build_examples
authorAnton Maklakov <anton@espressif.com>
Wed, 28 Jun 2017 03:40:54 +0000 (11:40 +0800)
committerAnton Maklakov <anton@espressif.com>
Fri, 7 Jul 2017 03:03:25 +0000 (11:03 +0800)
    Now the tests do not pass

    Before we had incorrect code of the error code checking
    in build_examples.sh for that case and did nothing in test_build_system.sh.

tools/ci/build_examples.sh
tools/ci/test_build_system.sh

index 04a1ebf8257bb5d327e552357c24f5b7e2247395..c87c141a72d0327812e4cba4b4f4422f09fd4e03 100755 (executable)
@@ -50,6 +50,7 @@ die() {
 export BATCH_BUILD=1
 export V=0 # only build verbose if there's an error
 
+shopt -s lastpipe # Workaround for Bash to use variables in loops (http://mywiki.wooledge.org/BashFAQ/024)
 RESULT=0
 FAILED_EXAMPLES=""
 
@@ -113,9 +114,12 @@ build_example () {
         # build non-verbose first
         local BUILDLOG=$(mktemp -t examplebuild.XXXX.log)
         (
-            make clean defconfig
-            make all 2>&1 | tee "${BUILDLOG}"
-        ) || { RESULT=$?; FAILED_EXAMPLES+=" ${EXAMPLE_NAME}"; make V=1; } # verbose output for errors
+            make clean defconfig &> >(tee -a "${BUILDLOG}") &&
+            make all &> >(tee -a "${BUILDLOG}")
+        ) || {
+            RESULT=$?; FAILED_EXAMPLES+=" ${EXAMPLE_NAME}"
+            make V=1 clean defconfig && make V=1 # verbose output for errors
+        }
     popd
 
     if grep ": warning:" "${BUILDLOG}" 2>&1 >> "${LOG_WARNINGS}"; then
index cc7cc9e12821cdfcbaba6d46f4d8bf65f8ce7d5e..c4da2f8e90e6ac321b263bfb090b3c79a588fe56 100755 (executable)
@@ -48,6 +48,9 @@ function run_tests()
     print_status "Updating template config..."
     make defconfig || exit $?
 
+    print_status "Try to clean fresh directory..."
+    make clean || exit $?
+
     BOOTLOADER_BINS="bootloader/bootloader.elf bootloader/bootloader.bin"
     APP_BINS="app-template.elf app-template.bin"