]> granicus.if.org Git - esp-idf/commitdiff
Add -Wstrict-prototypes check in CI
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 19 Mar 2019 08:02:35 +0000 (16:02 +0800)
committerAnton Maklakov <anton@espressif.com>
Thu, 1 Aug 2019 09:28:56 +0000 (16:28 +0700)
tools/ci/build_examples.sh
tools/ci/build_examples_cmake.sh
tools/ci/config/build.yml
tools/ci/configure_ci_environment.sh

index c300452e756a20da1c34eb09f4eb4771fa15761c..7393cb3024f70a63dca387660caefa362c0200e8 100755 (executable)
@@ -116,7 +116,7 @@ build_example () {
     pushd "example_builds/${ID}/${EXAMPLE_DIR_REL}"
         # be stricter in the CI build than the default IDF settings
         export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
-        export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
+        export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
 
         # sdkconfig files are normally not checked into git, but may be present when
         # a developer runs this script locally
index 6ec906b0dce5b27fad35ee5d39166d0490836b51..da15bae72563bba42372c06aed15eabf0d1feaee 100755 (executable)
@@ -111,7 +111,7 @@ build_example () {
     pushd "example_builds/${IDF_TARGET}/${ID}/${EXAMPLE_NAME}"
         # be stricter in the CI build than the default IDF settings
         export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
-        export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
+        export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
 
         # sdkconfig files are normally not checked into git, but may be present when
         # a developer runs this script locally
index c5dab206d9372d84122fb1d9bcd39b802e4d60b9..43bf40814911b006aba0268775ee84bd106e4886 100644 (file)
@@ -38,11 +38,13 @@ build_template_app:
     # Set the variable for 'esp-idf-template' testing
     - ESP_IDF_TEMPLATE_GIT=${ESP_IDF_TEMPLATE_GIT:-"https://github.com/espressif/esp-idf-template.git"}
     - git clone ${ESP_IDF_TEMPLATE_GIT}
+    # Try to use the same branch name for esp-idf-template that we're
+    # using on esp-idf. If it doesn't exist then just stick to the default branch
     - python $CHECKOUT_REF_SCRIPT esp-idf-template esp-idf-template
     - cd esp-idf-template
-    # Try to use the same branch name for esp-idf-template that we're
-    # using on esp-idf. If it doesn't exist then just stick to the default
-    # branch
+    - export PATH="$IDF_PATH/tools:$PATH"
+    - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
+    - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
     - make defconfig
     # Test debug build (default)
     - make all V=1
@@ -51,10 +53,17 @@ build_template_app:
     - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
     - make all V=1
     # Check if there are any stray printf/ets_printf references in WiFi libs
-    - cd ../components/esp_wifi/lib_esp32
+    - pushd ../components/esp_wifi/lib_esp32
     - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
     - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
-
+    - popd
+    # Repeat the build using CMake
+    - rm -rf build sdkconfig
+    # Debug build
+    - idf.py build
+    # Release build
+    - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
+    - idf.py build
 
 build_ssc:
   extends: .build_template
@@ -81,7 +90,7 @@ build_esp_idf_tests_make:
   extends: .build_esp_idf_unit_test_template
   script:
     - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
-    - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
+    - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
     - cd $CI_PROJECT_DIR/tools/unit-test-app
     - MAKEFLAGS= make help # make sure kconfig tools are built in single process
     - make ut-clean-all-configs
@@ -97,7 +106,7 @@ build_esp_idf_tests_cmake:
   script:
     - export PATH="$IDF_PATH/tools:$PATH"
     - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
-    - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
+    - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
     - cd $CI_PROJECT_DIR/tools/unit-test-app
     - idf.py ut-clean-all-configs
     - idf.py ut-build-all-configs
index 9a664c1ce9e90b284c5e0c9d0ea08f0f5e24d92f..d16e80500e7442bee288f041e72ea5dca1482b69 100644 (file)
@@ -15,4 +15,7 @@ DEBUG_SHELL=${DEBUG_SHELL:-"0"}
 
 # Compiler flags to thoroughly check the IDF code in some CI jobs
 # (Depends on default options '-Wno-error=XXX' used in the IDF build system)
-export PEDANTIC_CFLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
+
+PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
+export PEDANTIC_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
+export PEDANTIC_CXXFLAGS="${PEDANTIC_FLAGS}"