]> granicus.if.org Git - esp-idf/commitdiff
ci: Use more pedantic checking for examples and ut
authorAnton Maklakov <anton@espressif.com>
Tue, 27 Nov 2018 11:16:18 +0000 (19:16 +0800)
committerAnton Maklakov <anton@espressif.com>
Mon, 10 Dec 2018 04:34:16 +0000 (12:34 +0800)
.gitlab-ci.yml
tools/ci/build_examples.sh
tools/ci/build_examples_cmake.sh
tools/ci/configure_ci_environment.sh
tools/ci/test_configure_ci_environment.sh

index b778bed88dd39dd281699b76efbef173e0945934..294fe3b0583cc8f944f1c1ecf38a9d7c3480106f 100644 (file)
@@ -200,15 +200,15 @@ build_ssc_02:
 build_esp_idf_tests_make:
   <<: *build_esp_idf_unit_test_template
   script:
-    - export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
+    - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
     - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
     - 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
     - make ut-build-all-configs
     - python tools/UnitTestParser.py
+    # Check if the tests demand Make built binaries. If not, delete them
     - if [ "$UNIT_TEST_BUILD_SYSTEM" == "make" ]; then exit 0; fi
-    # If Make, delete the CMake built artifacts
     - rm -rf builds output sdkconfig
     - rm -rf components/idf_test/unit_test/TestCaseAll.yml
     - rm -rf components/idf_test/unit_test/CIConfigs/*.yml
@@ -217,16 +217,14 @@ build_esp_idf_tests_cmake:
   <<: *build_esp_idf_unit_test_template
   script:
     - export PATH="$IDF_PATH/tools:$PATH"
-    - export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
+    - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
     - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
     - cd $CI_PROJECT_DIR/tools/unit-test-app
-    # Build with CMake first
     - idf.py ut-clean-all-configs
     - idf.py ut-build-all-configs
     - python tools/UnitTestParser.py
-    # Check if test demands CMake or Make built binaries. If CMake leave the built artifacts as is then exit.
+    # Check if the tests demand CMake built binaries. If not, delete them
     - if [ "$UNIT_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi
-    # If Make, delete the CMake built artifacts
     - rm -rf builds output sdkconfig
     - rm -rf components/idf_test/unit_test/TestCaseAll.yml
     - rm -rf components/idf_test/unit_test/CIConfigs/*.yml
index 9ab8fee578713d0905a8bd6db40c803d37af8502..eb8a5993ae90968648c68c0c3734a15b79f6fe46 100755 (executable)
@@ -129,7 +129,7 @@ build_example () {
     local EXAMPLE_DIR_REL=${EXAMPLE_DIR#"${COPY_ROOT_PARENT}"}
     pushd "example_builds/${ID}/${EXAMPLE_DIR_REL}"
         # be stricter in the CI build than the default IDF settings
-        export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
+        export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
         export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
 
         # build non-verbose first
index 86862198141555824d357f799213eccc1324b3ce..009cc220595518af2ac44bc50f32369abedfdfbf 100755 (executable)
@@ -119,7 +119,7 @@ build_example () {
     cp -r "${EXAMPLE_DIR}" "example_builds/${ID}"
     pushd "example_builds/${ID}/${EXAMPLE_NAME}"
         # be stricter in the CI build than the default IDF settings
-        export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
+        export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
         export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
 
         # build non-verbose first
index a92600e92a7a31ccf7006a2c257f09db00bb4704..1d4380ad56de36a92bbe5f1a1bf1e9729c90c8e2 100644 (file)
@@ -30,3 +30,7 @@ else
     export IS_PUBLIC=
 fi
 unset REF
+
+# 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="-Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
index 1ad5f430ca80523e7bc0e68365fce4a22f460913..8f513de95d8acf1305a981ab01a63942d12ab575 100755 (executable)
@@ -30,5 +30,9 @@ assert_branch_public v1.2-rc77 1
 assert_branch_public v1.2.3-rc1 1
 assert_branch_public v1.2.3invalid
 
-rm -f .gitmodules
+(
+    . ./configure_ci_environment.sh
+    [[ $PEDANTIC_CFLAGS ]] || { echo "PEDANTIC_CFLAGS is not defined"; exit 1; }
+) || { exit 1; }
 
+rm -f .gitmodules