]> granicus.if.org Git - esp-idf/commitdiff
ci: update for running cmake examples
authorRenz Christian Bagaporo <renz@espressif.com>
Wed, 7 Nov 2018 07:19:56 +0000 (15:19 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Tue, 27 Nov 2018 11:56:52 +0000 (19:56 +0800)
.flake8
tools/ci/build_examples.sh
tools/ci/build_examples_cmake.sh
tools/ci/check_examples_cmake_make.sh
tools/ci/executable-list.txt
tools/ci/mirror-list.txt
tools/ci/test_build_system_cmake.sh

diff --git a/.flake8 b/.flake8
index db94eed6fe79e88706462760229daff1fafd8909..be4d0fd62b4541fdde5657b67c3d5d368322bbda 100644 (file)
--- a/.flake8
+++ b/.flake8
@@ -33,6 +33,7 @@ exclude =
         components/mbedtls/mbedtls,
         components/expat/expat,
         components/unity/unity,
+        examples/build_system/cmake/import_lib/main/lib/tinyxml2
     # temporary list (should be empty)
         components/app_update/dump_otadata.py,
         components/app_update/gen_empty_partition.py,
index b17e5625e8a80053f2a5802808050acda4a26350..9ab8fee578713d0905a8bd6db40c803d37af8502 100755 (executable)
@@ -62,6 +62,8 @@ RESULT_ISSUES=22  # magic number result code for issues found
 LOG_SUSPECTED=${LOG_PATH}/common_log.txt
 touch ${LOG_SUSPECTED}
 
+EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile | grep -v "/build_system/cmake/" | sort )
+
 if [ $# -eq 0 ]
 then
     START_NUM=0
@@ -84,7 +86,7 @@ else
     [ -z ${NUM_OF_JOBS} ] && die "NUM_OF_JOBS is bad"
 
     # count number of examples
-    NUM_OF_EXAMPLES=$( find ${IDF_PATH}/examples/ -type f -name Makefile | wc -l )
+    NUM_OF_EXAMPLES=$( echo "${EXAMPLE_PATHS}" | wc -l )
     [ -z ${NUM_OF_EXAMPLES} ] && die "NUM_OF_EXAMPLES is bad"
 
     # separate intervals
@@ -155,17 +157,16 @@ build_example () {
 
 EXAMPLE_NUM=0
 
-find ${IDF_PATH}/examples -type f -name Makefile | sort | \
-while read FN
+for EXAMPLE_PATH in ${EXAMPLE_PATHS}
 do
     if [[ $EXAMPLE_NUM -lt $START_NUM || $EXAMPLE_NUM -ge $END_NUM ]]
     then
         EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
         continue
     fi
-    echo ">>> example [ ${EXAMPLE_NUM} ] - $FN"
+    echo ">>> example [ ${EXAMPLE_NUM} ] - $EXAMPLE_PATH"
 
-    build_example "${EXAMPLE_NUM}" "${FN}"
+    build_example "${EXAMPLE_NUM}" "${EXAMPLE_PATH}"
 
     EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
 done
index 50ce7f1e61d39a4b88dcb00b41df0e0aedec3e0f..86862198141555824d357f799213eccc1324b3ce 100755 (executable)
@@ -126,8 +126,13 @@ build_example () {
         local BUILDLOG=${LOG_PATH}/ex_${ID}_log.txt
         touch ${BUILDLOG}
 
-        idf.py fullclean >>${BUILDLOG} 2>&1 &&
-        idf.py build >>${BUILDLOG} 2>&1 &&
+        if [ "$EXAMPLE_NAME" != "idf_as_lib" ]; then
+            idf.py fullclean >>${BUILDLOG} 2>&1 &&
+            idf.py build >>${BUILDLOG} 2>&1
+        else
+            rm -rf build sdkconfig &&
+            ./build.sh >>${BUILDLOG} 2>&1
+        fi &&
         cp build/flash_project_args build/download.config || # backwards compatible download.config filename
         {
             RESULT=$?; FAILED_EXAMPLES+=" ${EXAMPLE_NAME}" ;
index 28b5a5b245f678b8f7b04f467a0dd8f4bf1f3091..64463ab2140f0db98b2fe0eede45c68dc33aec7d 100755 (executable)
@@ -2,8 +2,8 @@
 
 # While we support GNU Make & CMake together, check the same examples are present for both
 
-CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/")
-MAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile )
+CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/" | grep -v "/build_system/cmake/")
+MAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile | grep -v "/build_system/cmake/")
 
 CMAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $CMAKE_EXAMPLE_PATHS | sort -n)"
 MAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $MAKE_EXAMPLE_PATHS | sort -n)"
index 65f765fe2ed0a924366ac85cac82ae5f4a913bed..6c3756fe6f0afe4d7b9dc13aead334597465aa2b 100644 (file)
@@ -66,4 +66,5 @@ components/espcoredump/test/test_espcoredump.py
 components/espcoredump/test/test_espcoredump.sh
 tools/ldgen/ldgen.py
 tools/ldgen/test/test_fragments.py
-tools/ldgen/test/test_generation.py
\ No newline at end of file
+tools/ldgen/test/test_generation.py
+examples/build_system/cmake/idf_as_lib/build.sh
index 6c55df1733223efc100ed2241c427769522e7840..9b9ac550a57a2d5b1ff8fa3640a94053779d5a25 100644 (file)
@@ -1,19 +1,20 @@
-components/esp32/lib                                @GENERAL_MIRROR_SERVER@/idf/esp32-wifi-lib.git
-components/bt/lib                                   @GENERAL_MIRROR_SERVER@/idf/esp32-bt-lib.git
-components/aws_iot/aws-iot-device-sdk-embedded-C    @GENERAL_MIRROR_SERVER@/idf/aws-iot-device-sdk-embedded-C.git   ALLOW_TO_SYNC_FROM_PUBLIC
-components/coap/libcoap                             @GENERAL_MIRROR_SERVER@/idf/libcoap.git                         ALLOW_TO_SYNC_FROM_PUBLIC
-components/esptool_py/esptool                       @GENERAL_MIRROR_SERVER@/idf/esptool.git                         ALLOW_TO_SYNC_FROM_PUBLIC
-components/json/cJSON                               @GENERAL_MIRROR_SERVER@/idf/cJSON.git                           ALLOW_TO_SYNC_FROM_PUBLIC
-components/libsodium/libsodium                      @GENERAL_MIRROR_SERVER@/idf/libsodium.git                       ALLOW_TO_SYNC_FROM_PUBLIC
-components/mbedtls/mbedtls                          @GENERAL_MIRROR_SERVER@/idf/mbedtls.git                         ALLOW_TO_SYNC_FROM_PUBLIC
-components/expat/expat                              @GENERAL_MIRROR_SERVER@/idf/libexpat.git                        ALLOW_TO_SYNC_FROM_PUBLIC
-components/micro-ecc/micro-ecc                      @GENERAL_MIRROR_SERVER@/idf/micro-ecc.git                       ALLOW_TO_SYNC_FROM_PUBLIC
-components/nghttp/nghttp2                           @GENERAL_MIRROR_SERVER@/idf/nghttp2.git                         ALLOW_TO_SYNC_FROM_PUBLIC
-components/spiffs/spiffs                            @GENERAL_MIRROR_SERVER@/idf/spiffs.git                          ALLOW_TO_SYNC_FROM_PUBLIC
-components/asio/asio                                @GENERAL_MIRROR_SERVER@/idf/asio.git
-components/lwip/lwip                                @GENERAL_MIRROR_SERVER@/idf/esp-lwip.git
-third-party/mruby                                   @GENERAL_MIRROR_SERVER@/idf/mruby.git                           ALLOW_TO_SYNC_FROM_PUBLIC
-third-party/neverbleed                              @GENERAL_MIRROR_SERVER@/idf/neverbleed.git                      ALLOW_TO_SYNC_FROM_PUBLIC
-components/mqtt/esp-mqtt                            @GENERAL_MIRROR_SERVER@/idf/esp-mqtt.git                        ALLOW_TO_SYNC_FROM_PUBLIC
-components/protobuf-c/protobuf-c                    @GENERAL_MIRROR_SERVER@/idf/protobuf-c.git                      ALLOW_TO_SYNC_FROM_PUBLIC
-components/unity/unity                              @GENERAL_MIRROR_SERVER@/idf/Unity.git                           ALLOW_TO_SYNC_FROM_PUBLIC
\ No newline at end of file
+components/esp32/lib                                        @GENERAL_MIRROR_SERVER@/idf/esp32-wifi-lib.git
+components/bt/lib                                           @GENERAL_MIRROR_SERVER@/idf/esp32-bt-lib.git
+components/aws_iot/aws-iot-device-sdk-embedded-C            @GENERAL_MIRROR_SERVER@/idf/aws-iot-device-sdk-embedded-C.git   ALLOW_TO_SYNC_FROM_PUBLIC
+components/coap/libcoap                                     @GENERAL_MIRROR_SERVER@/idf/libcoap.git                         ALLOW_TO_SYNC_FROM_PUBLIC
+components/esptool_py/esptool                               @GENERAL_MIRROR_SERVER@/idf/esptool.git                         ALLOW_TO_SYNC_FROM_PUBLIC
+components/json/cJSON                                       @GENERAL_MIRROR_SERVER@/idf/cJSON.git                           ALLOW_TO_SYNC_FROM_PUBLIC
+components/libsodium/libsodium                              @GENERAL_MIRROR_SERVER@/idf/libsodium.git                       ALLOW_TO_SYNC_FROM_PUBLIC
+components/mbedtls/mbedtls                                  @GENERAL_MIRROR_SERVER@/idf/mbedtls.git                         ALLOW_TO_SYNC_FROM_PUBLIC
+components/expat/expat                                      @GENERAL_MIRROR_SERVER@/idf/libexpat.git                        ALLOW_TO_SYNC_FROM_PUBLIC
+components/micro-ecc/micro-ecc                              @GENERAL_MIRROR_SERVER@/idf/micro-ecc.git                       ALLOW_TO_SYNC_FROM_PUBLIC
+components/nghttp/nghttp2                                   @GENERAL_MIRROR_SERVER@/idf/nghttp2.git                         ALLOW_TO_SYNC_FROM_PUBLIC
+components/spiffs/spiffs                                    @GENERAL_MIRROR_SERVER@/idf/spiffs.git                          ALLOW_TO_SYNC_FROM_PUBLIC
+components/asio/asio                                        @GENERAL_MIRROR_SERVER@/idf/asio.git
+components/lwip/lwip                                        @GENERAL_MIRROR_SERVER@/idf/esp-lwip.git
+third-party/mruby                                           @GENERAL_MIRROR_SERVER@/idf/mruby.git                           ALLOW_TO_SYNC_FROM_PUBLIC
+third-party/neverbleed                                      @GENERAL_MIRROR_SERVER@/idf/neverbleed.git                      ALLOW_TO_SYNC_FROM_PUBLIC
+components/mqtt/esp-mqtt                                    @GENERAL_MIRROR_SERVER@/idf/esp-mqtt.git                        ALLOW_TO_SYNC_FROM_PUBLIC
+components/protobuf-c/protobuf-c                            @GENERAL_MIRROR_SERVER@/idf/protobuf-c.git                      ALLOW_TO_SYNC_FROM_PUBLIC
+components/unity/unity                                      @GENERAL_MIRROR_SERVER@/idf/Unity.git                           ALLOW_TO_SYNC_FROM_PUBLIC
+examples/build_system/cmake/import_lib/main/lib/tinyxml2    @GENERAL_MIRROR_SERVER@/idf/tinyxml2.git                        ALLOW_TO_SYNC_FROM_PUBLIC
index 1e38e189009ae582cd34daaa26079f9d8bc82f75..1a73c16e635792632e561d64fc83f8b408f08563 100755 (executable)
@@ -58,6 +58,7 @@ function run_tests()
     BOOTLOADER_BINS="bootloader/bootloader.elf bootloader/bootloader.bin"
     APP_BINS="app-template.elf app-template.bin"
     PARTITION_BIN="partition_table/partition-table.bin"
+    IDF_COMPONENT_PREFIX="idf_component"
 
     print_status "Initial clean build"
     # if build fails here, everything fails
@@ -71,14 +72,14 @@ function run_tests()
     take_build_snapshot
     touch ${IDF_PATH}/components/esp32/cpu_start.c
     idf.py build || failure "Failed to partial build"
-    assert_rebuilt ${APP_BINS} esp32/libesp32.a esp32/CMakeFiles/esp32.dir/cpu_start.c.obj
-    assert_not_rebuilt lwip/liblwip.a freertos/libfreertos.a ${BOOTLOADER_BINS} ${PARTITION_BIN}
+    assert_rebuilt ${APP_BINS} esp-idf/esp32/libesp32.a esp-idf/esp32/CMakeFiles/${IDF_COMPONENT_PREFIX}_esp32.dir/cpu_start.c.obj
+    assert_not_rebuilt esp-idf/lwip/liblwip.a esp-idf/freertos/libfreertos.a ${BOOTLOADER_BINS} ${PARTITION_BIN}
 
     print_status "Bootloader source file rebuilds bootloader"
     take_build_snapshot
     touch ${IDF_PATH}/components/bootloader/subproject/main/bootloader_start.c
     idf.py build || failure "Failed to partial build bootloader"
-    assert_rebuilt ${BOOTLOADER_BINS} bootloader/main/CMakeFiles/main.dir/bootloader_start.c.obj
+    assert_rebuilt ${BOOTLOADER_BINS} bootloader/esp-idf/main/CMakeFiles/${IDF_COMPONENT_PREFIX}_main.dir/bootloader_start.c.obj
     assert_not_rebuilt ${APP_BINS} ${PARTITION_BIN}
 
     print_status "Partition CSV file rebuilds partitions"
@@ -172,9 +173,9 @@ function run_tests()
     assert_rebuilt config/sdkconfig.h
     # pick one each of .c, .cpp, .S that #includes sdkconfig.h
     # and therefore should rebuild
-    assert_rebuilt newlib/CMakeFiles/newlib.dir/syscall_table.c.obj
-    assert_rebuilt nvs_flash/CMakeFiles/nvs_flash.dir/src/nvs_api.cpp.obj
-    assert_rebuilt freertos/CMakeFiles/freertos.dir/xtensa_vectors.S.obj
+    assert_rebuilt esp-idf/newlib/CMakeFiles/${IDF_COMPONENT_PREFIX}_newlib.dir/syscall_table.c.obj
+    assert_rebuilt esp-idf/nvs_flash/CMakeFiles/${IDF_COMPONENT_PREFIX}_nvs_flash.dir/src/nvs_api.cpp.obj
+    assert_rebuilt esp-idf/freertos/CMakeFiles/${IDF_COMPONENT_PREFIX}_freertos.dir/xtensa_vectors.S.obj
 
     print_status "Updating project CMakeLists.txt triggers full recompile"
     clean_build_dir
@@ -186,9 +187,9 @@ function run_tests()
     idf.py build || failure "Build failed"
     mv CMakeLists.bak CMakeLists.txt
     # similar to previous test
-    assert_rebuilt newlib/CMakeFiles/newlib.dir/syscall_table.c.obj
-    assert_rebuilt nvs_flash/CMakeFiles/nvs_flash.dir/src/nvs_api.cpp.obj
-    assert_rebuilt freertos/CMakeFiles/freertos.dir/xtensa_vectors.S.obj
+    assert_rebuilt esp-idf/newlib/CMakeFiles/${IDF_COMPONENT_PREFIX}_newlib.dir/syscall_table.c.obj
+    assert_rebuilt esp-idf/nvs_flash/CMakeFiles/${IDF_COMPONENT_PREFIX}_nvs_flash.dir/src/nvs_api.cpp.obj
+    assert_rebuilt esp-idf/freertos/CMakeFiles/${IDF_COMPONENT_PREFIX}_freertos.dir/xtensa_vectors.S.obj
 
     print_status "Can build with Ninja (no idf.py)"
     clean_build_dir