mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 20:54:32 +02:00
ci: Use more pedantic checking for examples and ut
This commit is contained in:
@@ -200,15 +200,15 @@ build_ssc_02:
|
|||||||
build_esp_idf_tests_make:
|
build_esp_idf_tests_make:
|
||||||
<<: *build_esp_idf_unit_test_template
|
<<: *build_esp_idf_unit_test_template
|
||||||
script:
|
script:
|
||||||
- export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
|
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
|
||||||
- export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
- export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||||
- cd $CI_PROJECT_DIR/tools/unit-test-app
|
- cd $CI_PROJECT_DIR/tools/unit-test-app
|
||||||
- MAKEFLAGS= make help # make sure kconfig tools are built in single process
|
- MAKEFLAGS= make help # make sure kconfig tools are built in single process
|
||||||
- make ut-clean-all-configs
|
- make ut-clean-all-configs
|
||||||
- make ut-build-all-configs
|
- make ut-build-all-configs
|
||||||
- python tools/UnitTestParser.py
|
- 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 [ "$UNIT_TEST_BUILD_SYSTEM" == "make" ]; then exit 0; fi
|
||||||
# If Make, delete the CMake built artifacts
|
|
||||||
- rm -rf builds output sdkconfig
|
- rm -rf builds output sdkconfig
|
||||||
- rm -rf components/idf_test/unit_test/TestCaseAll.yml
|
- rm -rf components/idf_test/unit_test/TestCaseAll.yml
|
||||||
- rm -rf components/idf_test/unit_test/CIConfigs/*.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
|
<<: *build_esp_idf_unit_test_template
|
||||||
script:
|
script:
|
||||||
- export PATH="$IDF_PATH/tools:$PATH"
|
- export PATH="$IDF_PATH/tools:$PATH"
|
||||||
- export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
|
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
|
||||||
- export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
- export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||||
- cd $CI_PROJECT_DIR/tools/unit-test-app
|
- cd $CI_PROJECT_DIR/tools/unit-test-app
|
||||||
# Build with CMake first
|
|
||||||
- idf.py ut-clean-all-configs
|
- idf.py ut-clean-all-configs
|
||||||
- idf.py ut-build-all-configs
|
- idf.py ut-build-all-configs
|
||||||
- python tools/UnitTestParser.py
|
- 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 [ "$UNIT_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi
|
||||||
# If Make, delete the CMake built artifacts
|
|
||||||
- rm -rf builds output sdkconfig
|
- rm -rf builds output sdkconfig
|
||||||
- rm -rf components/idf_test/unit_test/TestCaseAll.yml
|
- rm -rf components/idf_test/unit_test/TestCaseAll.yml
|
||||||
- rm -rf components/idf_test/unit_test/CIConfigs/*.yml
|
- rm -rf components/idf_test/unit_test/CIConfigs/*.yml
|
||||||
|
@@ -129,7 +129,7 @@ build_example () {
|
|||||||
local EXAMPLE_DIR_REL=${EXAMPLE_DIR#"${COPY_ROOT_PARENT}"}
|
local EXAMPLE_DIR_REL=${EXAMPLE_DIR#"${COPY_ROOT_PARENT}"}
|
||||||
pushd "example_builds/${ID}/${EXAMPLE_DIR_REL}"
|
pushd "example_builds/${ID}/${EXAMPLE_DIR_REL}"
|
||||||
# be stricter in the CI build than the default IDF settings
|
# 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}
|
export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||||
|
|
||||||
# build non-verbose first
|
# build non-verbose first
|
||||||
|
@@ -119,7 +119,7 @@ build_example () {
|
|||||||
cp -r "${EXAMPLE_DIR}" "example_builds/${ID}"
|
cp -r "${EXAMPLE_DIR}" "example_builds/${ID}"
|
||||||
pushd "example_builds/${ID}/${EXAMPLE_NAME}"
|
pushd "example_builds/${ID}/${EXAMPLE_NAME}"
|
||||||
# be stricter in the CI build than the default IDF settings
|
# 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}
|
export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||||
|
|
||||||
# build non-verbose first
|
# build non-verbose first
|
||||||
|
@@ -30,3 +30,7 @@ else
|
|||||||
export IS_PUBLIC=
|
export IS_PUBLIC=
|
||||||
fi
|
fi
|
||||||
unset REF
|
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"
|
||||||
|
@@ -30,5 +30,9 @@ assert_branch_public v1.2-rc77 1
|
|||||||
assert_branch_public v1.2.3-rc1 1
|
assert_branch_public v1.2.3-rc1 1
|
||||||
assert_branch_public v1.2.3invalid
|
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
|
||||||
|
Reference in New Issue
Block a user