diff --git a/.gitignore b/.gitignore index bb0c765b21..cec3c3c100 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,10 @@ tools/unit-test-app/sdkconfig.old tools/unit-test-app/build tools/unit-test-app/builds tools/unit-test-app/output +tools/unit-test-app/test_configs + +# Unit Test CMake compile log folder +log_ut_cmake # IDF monitor test tools/test_idf_monitor/outputs diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48e90f71ae..9845ba9b3c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,7 +33,6 @@ variables: # tell build system do not check submodule update as we download archive instead of clone IDF_SKIP_CHECK_SUBMODULES: 1 - UNIT_TEST_BUILD_SYSTEM: cmake EXAMPLE_TEST_BUILD_SYSTEM: cmake IDF_PATH: "$CI_PROJECT_DIR" BATCH_BUILD: "1" diff --git a/tools/ci/build_unit_test.sh b/tools/ci/build_unit_test.sh new file mode 100755 index 0000000000..dd4402f1d9 --- /dev/null +++ b/tools/ci/build_unit_test.sh @@ -0,0 +1,107 @@ +#!/bin/bash +# +# Build unit test app +# +# Runs as part of CI process. +# + +# ----------------------------------------------------------------------------- +# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d). + +if [[ ! -z ${DEBUG_SHELL} ]] +then + set -x # Activate the expand mode if DEBUG is anything but empty. +fi + +set -o errexit # Exit if command failed. +set -o pipefail # Exit if pipe failed. + +export PATH="$IDF_PATH/tools/ci:$IDF_PATH/tools:$PATH" + +# ----------------------------------------------------------------------------- + +die() { + echo "${1:-"Unknown Error"}" 1>&2 + exit 1 +} + +[ -z ${IDF_PATH} ] && die "IDF_PATH is not set" +[ -z ${LOG_PATH} ] && die "LOG_PATH is not set" +[ -z ${IDF_TARGET} ] && die "IDF_TARGET is not set" +[ -d ${LOG_PATH} ] || mkdir -p ${LOG_PATH} + +# Relative to IDF_PATH +# If changing the BUILD_PATH, remember to update the "artifacts" in gitlab-ci configs, and IDFApp.py. +BUILD_PATH=${IDF_PATH}/tools/unit-test-app/builds +OUTPUT_PATH=${IDF_PATH}/tools/unit-test-app/output +mkdir -p ${BUILD_PATH}/${IDF_TARGET} +mkdir -p ${OUTPUT_PATH}/${IDF_TARGET} + +if [ -z ${CI_NODE_TOTAL} ]; then + CI_NODE_TOTAL=1 + echo "Assuming CI_NODE_TOTAL=${CI_NODE_TOTAL}" +fi +if [ -z ${CI_NODE_INDEX} ]; then + # Gitlab uses a 1-based index + CI_NODE_INDEX=1 + echo "Assuming CI_NODE_INDEX=${CI_NODE_INDEX}" +fi + + +set -o nounset # Exit if variable not set. + +# Convert LOG_PATH to relative, to make the json file less verbose. +LOG_PATH=$(realpath --relative-to ${IDF_PATH} ${LOG_PATH}) + +ALL_BUILD_LIST_JSON="${BUILD_PATH}/${IDF_TARGET}/list.json" +JOB_BUILD_LIST_JSON="${BUILD_PATH}/${IDF_TARGET}/list_job_${CI_NODE_INDEX}.json" + +echo "build_unit_test running for target $IDF_TARGET" + +cd ${IDF_PATH} + +# This part of the script produces the same result for all the unit test app build jobs. It may be moved to a separate stage +# (pre-build) later, then the build jobs will receive ${BUILD_LIST_JSON} file as an artifact. + +${IDF_PATH}/tools/find_apps.py tools/unit-test-app \ + -vv \ + --format json \ + --build-system cmake \ + --target ${IDF_TARGET} \ + --recursive \ + --build-dir "builds/@t/@w" \ + --build-log "${LOG_PATH}/@w.txt" \ + --output ${ALL_BUILD_LIST_JSON} \ + --config 'configs/*=' + +# The part below is where the actual builds happen + +${IDF_PATH}/tools/build_apps.py \ + -vv \ + --format json \ + --keep-going \ + --parallel-count ${CI_NODE_TOTAL} \ + --parallel-index ${CI_NODE_INDEX} \ + --output-build-list ${JOB_BUILD_LIST_JSON} \ + ${ALL_BUILD_LIST_JSON}\ + +# Copy build artifacts to output directory +build_names=$(cd ${BUILD_PATH}/${IDF_TARGET}; find . -maxdepth 1 \! -name . -prune -type d | cut -c 3-) +for build_name in $build_names; do + src=${BUILD_PATH}/${IDF_TARGET}/${build_name} + dst=${OUTPUT_PATH}/${IDF_TARGET}/${build_name} + echo "Copying artifacts from ${src} to ${dst}" + + rm -rf ${dst} + mkdir -p ${dst} + cp ${src}/{*.bin,*.elf,*.map,sdkconfig,flasher_args.json} ${dst}/ + + mkdir -p ${dst}/bootloader + cp ${src}/bootloader/*.bin ${dst}/bootloader/ + + mkdir -p ${dst}/partition_table + cp ${src}/partition_table/*.bin ${dst}/partition_table/ +done + +# Check for build warnings +${IDF_PATH}/tools/ci/check_build_warnings.py -vv ${JOB_BUILD_LIST_JSON} diff --git a/tools/ci/config/assign-test.yml b/tools/ci/config/assign-test.yml index 8fe3d149c1..3003ee4fda 100644 --- a/tools/ci/config/assign-test.yml +++ b/tools/ci/config/assign-test.yml @@ -1,4 +1,3 @@ - assign_test: tags: - assign_test @@ -8,12 +7,13 @@ assign_test: # we have a lot build example jobs. now we don't use dependencies, just download all artifacts of build stage. dependencies: - build_ssc_esp32 - - build_esp_idf_tests_cmake + - build_esp_idf_tests_cmake_esp32 + - build_esp_idf_tests_cmake_esp32s2 variables: SUBMODULES_TO_FETCH: "components/esptool_py/esptool" EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs" TEST_APP_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/tools/test_apps/test_configs" - UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml" + UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test" artifacts: paths: - components/idf_test/*/CIConfigs @@ -55,8 +55,8 @@ update_test_cases: - master - schedules dependencies: - - build_esp_idf_tests_make - - build_esp_idf_tests_cmake + - build_esp_idf_tests_cmake_esp32 + - build_esp_idf_tests_cmake_esp32s2 artifacts: when: always paths: @@ -64,7 +64,7 @@ update_test_cases: expire_in: 1 week variables: SUBMODULES_TO_FETCH: "components/esptool_py/esptool" - UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml" + UNIT_TEST_CASE_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test" BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml" AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script" PYTHON_VER: 3 @@ -75,7 +75,8 @@ update_test_cases: - cd test-management - echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE} # update unit test cases - - python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT unity -d $UNIT_TEST_CASE_FILE -r $GIT_SHA + - export UNIT_TEST_CASE_FILES=$(find $UNIT_TEST_CASE_DIR -maxdepth 1 -name "*.yml" | xargs) + - python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT unity -d $UNIT_TEST_CASE_FILES -r $GIT_SHA # update example test cases - python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/examples -r $GIT_SHA # organize test cases diff --git a/tools/ci/config/build.yml b/tools/ci/config/build.yml index 502220a234..5770acc827 100644 --- a/tools/ci/config/build.yml +++ b/tools/ci/config/build.yml @@ -8,27 +8,6 @@ BATCH_BUILD: "1" V: "0" -.build_esp_idf_unit_test_template: - extends: .build_template - artifacts: - paths: - - components/idf_test/unit_test/TestCaseAll.yml - # Keep only significant files in the output folder (mainly to get rid of .map files) - - tools/unit-test-app/output/*/*.bin - - tools/unit-test-app/output/*/sdkconfig - - tools/unit-test-app/output/*/*.elf - - tools/unit-test-app/output/*/flasher_args.json - - tools/unit-test-app/output/*/bootloader/*.bin - - tools/unit-test-app/output/*/partition_table/*.bin - expire_in: 4 days - only: - variables: - - $BOT_TRIGGER_WITH_LABEL == null - - $BOT_LABEL_BUILD - - $BOT_LABEL_UNIT_TEST - - $BOT_LABEL_UNIT_TEST_S2 - - $BOT_LABEL_REGULAR_TEST - .build_ssc_template: extends: .build_template parallel: 3 @@ -61,36 +40,42 @@ build_ssc_esp32s2: variables: TARGET_NAME: "ESP32S2" -build_esp_idf_tests_make: - extends: .build_esp_idf_unit_test_template +.build_esp_idf_tests_cmake: + extends: .build_template + artifacts: + paths: + - tools/unit-test-app/output/${IDF_TARGET} + - tools/unit-test-app/builds/${IDF_TARGET}/*.json + - components/idf_test/unit_test/*.yml + - ${LOG_PATH} + when: always + expire_in: 4 days + only: + variables: + - $BOT_TRIGGER_WITH_LABEL == null + - $BOT_LABEL_BUILD + - $BOT_LABEL_UNIT_TEST + - $BOT_LABEL_UNIT_TEST_S2 + - $BOT_LABEL_REGULAR_TEST + variables: + LOG_PATH: "$CI_PROJECT_DIR/log_ut_cmake" script: - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS} - - export IDF_TARGET=esp32 + - mkdir -p ${LOG_PATH} + - ${CI_PROJECT_DIR}/tools/ci/build_unit_test.sh - 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 - - rm -rf builds output sdkconfig - - rm $CI_PROJECT_DIR/components/idf_test/unit_test/TestCaseAll.yml -build_esp_idf_tests_cmake: - extends: .build_esp_idf_unit_test_template - script: - - export PATH="$IDF_PATH/tools:$PATH" - - export EXTRA_CFLAGS=${PEDANTIC_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 - - python tools/UnitTestParser.py - # Check if the tests demand CMake built binaries. If not, delete them - - if [ "$UNIT_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi - - rm -rf builds output sdkconfig - - rm $CI_PROJECT_DIR/components/idf_test/unit_test/TestCaseAll.yml +build_esp_idf_tests_cmake_esp32: + extends: .build_esp_idf_tests_cmake + variables: + IDF_TARGET: esp32 + +build_esp_idf_tests_cmake_esp32s2: + extends: .build_esp_idf_tests_cmake + variables: + IDF_TARGET: esp32s2 build_examples_make: extends: .build_template diff --git a/tools/ci/config/target-test.yml b/tools/ci/config/target-test.yml index ff1517ae90..d74cbdc22a 100644 --- a/tools/ci/config/target-test.yml +++ b/tools/ci/config/target-test.yml @@ -110,8 +110,7 @@ stage: target_test dependencies: - assign_test - - build_esp_idf_tests_make - - build_esp_idf_tests_cmake + - build_esp_idf_tests_cmake_esp32 only: refs: - master @@ -499,6 +498,9 @@ UT_034: .unit_test_s2_template: extends: .unit_test_template + dependencies: + - assign_test + - build_esp_idf_tests_cmake_esp32s2 only: refs: # Due to lack of runners, the tests are only done by manual trigger diff --git a/tools/ci/executable-list.txt b/tools/ci/executable-list.txt index 690ba367fe..319c02c698 100644 --- a/tools/ci/executable-list.txt +++ b/tools/ci/executable-list.txt @@ -36,6 +36,7 @@ tools/ci/apply_bot_filter.py tools/ci/build_examples.sh tools/ci/build_examples_cmake.sh tools/ci/build_test_apps.sh +tools/ci/build_unit_test.sh tools/ci/check-executable.sh tools/ci/check-line-endings.sh tools/ci/check_build_warnings.py @@ -43,7 +44,6 @@ tools/ci/check_deprecated_kconfigs.py tools/ci/check_examples_cmake_make.sh tools/ci/check_examples_rom_header.sh tools/ci/check_idf_version.sh -tools/ci/check_public_headers.sh tools/ci/check_ut_cmake_make.sh tools/ci/checkout_project_ref.py tools/ci/deploy_docs.py diff --git a/tools/find_apps.py b/tools/find_apps.py index e3dd48c4c0..478ed5f42c 100755 --- a/tools/find_apps.py +++ b/tools/find_apps.py @@ -35,7 +35,10 @@ def dict_from_sdkconfig(path): for line in f: m = regex.match(line) if m: - result[m.group(1)] = m.group(2) + val = m.group(2) + if val.startswith('"') and val.endswith('"'): + val = val[1:-1] + result[m.group(1)] = val return result diff --git a/tools/find_build_apps/cmake.py b/tools/find_build_apps/cmake.py index edaa7b2a0f..84dbeded66 100644 --- a/tools/find_build_apps/cmake.py +++ b/tools/find_build_apps/cmake.py @@ -15,12 +15,21 @@ IDF_PY = "idf.py" CMAKE_PROJECT_LINE = r"include($ENV{IDF_PATH}/tools/cmake/project.cmake)" SUPPORTED_TARGETS_REGEX = re.compile(r'Supported [Tt]argets((?:[\s|]+(?:ESP[0-9A-Z\-]+))+)') +SDKCONFIG_LINE_REGEX = re.compile(r"^([^=]+)=\"?([^\"\n]*)\"?\n*$") FORMAL_TO_USUAL = { 'ESP32': 'esp32', 'ESP32-S2': 'esp32s2', } +# If these keys are present in sdkconfig.defaults, they will be extracted and passed to CMake +SDKCONFIG_TEST_OPTS = [ + "EXCLUDE_COMPONENTS", + "TEST_EXCLUDE_COMPONENTS", + "TEST_COMPONENTS", + "TEST_GROUPS" +] + class CMakeBuildSystem(BuildSystem): NAME = BUILD_SYSTEM_CMAKE @@ -69,6 +78,7 @@ class CMakeBuildSystem(BuildSystem): if not build_item.dry_run: os.unlink(sdkconfig_file) + extra_cmakecache_items = {} logging.debug("Creating sdkconfig file: {}".format(sdkconfig_file)) if not build_item.dry_run: with open(sdkconfig_file, "w") as f_out: @@ -81,13 +91,11 @@ class CMakeBuildSystem(BuildSystem): for line in f_in: if not line.endswith("\n"): line += "\n" + m = SDKCONFIG_LINE_REGEX.match(line) + if m and m.group(1) in SDKCONFIG_TEST_OPTS: + extra_cmakecache_items[m.group(1)] = m.group(2) + continue f_out.write(os.path.expandvars(line)) - # Also save the sdkconfig file in the build directory - shutil.copyfile( - os.path.join(work_path, "sdkconfig"), - os.path.join(build_path, "sdkconfig"), - ) - else: for sdkconfig_name in sdkconfig_defaults_list: sdkconfig_path = os.path.join(app_path, sdkconfig_name) @@ -109,6 +117,11 @@ class CMakeBuildSystem(BuildSystem): work_path, "-DIDF_TARGET=" + build_item.target, ] + for key, val in extra_cmakecache_items.items(): + args.append("-D{}={}".format(key, val)) + if "TEST_EXCLUDE_COMPONENTS" in extra_cmakecache_items \ + and "TEST_COMPONENTS" not in extra_cmakecache_items: + args.append("-DTESTS_ALL=1") if build_item.verbose: args.append("-v") args.append("build") @@ -131,6 +144,12 @@ class CMakeBuildSystem(BuildSystem): subprocess.check_call(args, stdout=build_stdout, stderr=build_stderr) except subprocess.CalledProcessError as e: raise BuildError("Build failed with exit code {}".format(e.returncode)) + else: + # Also save the sdkconfig file in the build directory + shutil.copyfile( + os.path.join(work_path, "sdkconfig"), + os.path.join(build_path, "sdkconfig"), + ) finally: if log_file: log_file.close() diff --git a/tools/unit-test-app/configs/aes_no_hw b/tools/unit-test-app/configs/aes_no_hw index ae5802286a..029a7ba1a8 100644 --- a/tools/unit-test-app/configs/aes_no_hw +++ b/tools/unit-test-app/configs/aes_no_hw @@ -1,3 +1,4 @@ +# This config is for all targets TEST_EXCLUDE_COMPONENTS=libsodium bt app_update test_utils TEST_COMPONENTS=mbedtls CONFIG_MBEDTLS_HARDWARE_AES=n diff --git a/tools/unit-test-app/configs/aes_no_hw_s2 b/tools/unit-test-app/configs/aes_no_hw_s2 deleted file mode 100644 index 8d6305bf27..0000000000 --- a/tools/unit-test-app/configs/aes_no_hw_s2 +++ /dev/null @@ -1,4 +0,0 @@ -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update test_utils -TEST_COMPONENTS=mbedtls -CONFIG_MBEDTLS_HARDWARE_AES=n -CONFIG_IDF_TARGET="esp32s2" diff --git a/tools/unit-test-app/configs/app_update b/tools/unit-test-app/configs/app_update index 4069be24d1..efcc895ac4 100644 --- a/tools/unit-test-app/configs/app_update +++ b/tools/unit-test-app/configs/app_update @@ -1,3 +1,4 @@ +# This config is for all targets TEST_COMPONENTS=app_update TEST_EXCLUDE_COMPONENTS=libsodium bt CONFIG_UNITY_FREERTOS_STACK_SIZE=12288 diff --git a/tools/unit-test-app/configs/app_update_s2 b/tools/unit-test-app/configs/app_update_s2 deleted file mode 100644 index 50cf1444ec..0000000000 --- a/tools/unit-test-app/configs/app_update_s2 +++ /dev/null @@ -1,14 +0,0 @@ -TEST_COMPONENTS=app_update -TEST_EXCLUDE_COMPONENTS=libsodium bt -CONFIG_UNITY_FREERTOS_STACK_SIZE=12288 -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partition_table_unit_test_two_ota.csv" -CONFIG_PARTITION_TABLE_FILENAME="partition_table_unit_test_two_ota.csv" -CONFIG_PARTITION_TABLE_OFFSET=0x18000 -CONFIG_BOOTLOADER_FACTORY_RESET=y -CONFIG_BOOTLOADER_APP_TEST=y -CONFIG_BOOTLOADER_HOLD_TIME_GPIO=2 -CONFIG_BOOTLOADER_OTA_DATA_ERASE=y -CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4 -CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18 -CONFIG_IDF_TARGET="esp32s2" \ No newline at end of file diff --git a/tools/unit-test-app/configs/bt b/tools/unit-test-app/configs/bt index 4eb4677ec8..bec4468a7e 100644 --- a/tools/unit-test-app/configs/bt +++ b/tools/unit-test-app/configs/bt @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=bt TEST_EXCLUDE_COMPONENTS=app_update CONFIG_BT_ENABLED=y diff --git a/tools/unit-test-app/configs/cxx_exceptions b/tools/unit-test-app/configs/cxx_exceptions index ef85723f1a..47e6fce864 100644 --- a/tools/unit-test-app/configs/cxx_exceptions +++ b/tools/unit-test-app/configs/cxx_exceptions @@ -1,2 +1,4 @@ +# Only need to test this for one target (e.g. ESP32) +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=cxx CONFIG_COMPILER_CXX_EXCEPTIONS=y diff --git a/tools/unit-test-app/configs/cxx_rtti b/tools/unit-test-app/configs/cxx_rtti index c3ad83b81d..dc18eb6d21 100644 --- a/tools/unit-test-app/configs/cxx_rtti +++ b/tools/unit-test-app/configs/cxx_rtti @@ -1,3 +1,5 @@ +# Only need to test this for one target (e.g. ESP32) +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=cxx CONFIG_COMPILER_CXX_EXCEPTIONS=y CONFIG_COMPILER_CXX_RTTI=y diff --git a/tools/unit-test-app/configs/default b/tools/unit-test-app/configs/default index 70273aa973..5a1be7c8ec 100644 --- a/tools/unit-test-app/configs/default +++ b/tools/unit-test-app/configs/default @@ -1 +1,3 @@ +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=freertos esp32 esp_timer driver heap pthread soc spi_flash vfs \ No newline at end of file diff --git a/tools/unit-test-app/configs/default_2 b/tools/unit-test-app/configs/default_2 index 6bf0057d82..61d589d800 100644 --- a/tools/unit-test-app/configs/default_2 +++ b/tools/unit-test-app/configs/default_2 @@ -1 +1,3 @@ +# This config is split between targets since different component needs to be excluded (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_timer driver heap pthread soc spi_flash vfs test_utils diff --git a/tools/unit-test-app/configs/default_2_s2 b/tools/unit-test-app/configs/default_2_s2 index 049d2954f7..b091ce9190 100644 --- a/tools/unit-test-app/configs/default_2_s2 +++ b/tools/unit-test-app/configs/default_2_s2 @@ -1,2 +1,3 @@ +# This config is split between targets since different component needs to be excluded (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32s2" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs -CONFIG_IDF_TARGET="esp32s2" \ No newline at end of file diff --git a/tools/unit-test-app/configs/default_s2 b/tools/unit-test-app/configs/default_s2 index 7266531435..424ab33ff6 100644 --- a/tools/unit-test-app/configs/default_s2 +++ b/tools/unit-test-app/configs/default_s2 @@ -1,2 +1,3 @@ -TEST_COMPONENTS=freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs -CONFIG_IDF_TARGET="esp32s2" \ No newline at end of file +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32s2" +TEST_COMPONENTS=freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs \ No newline at end of file diff --git a/tools/unit-test-app/configs/flash_encryption b/tools/unit-test-app/configs/flash_encryption index 7334d67370..30b55ff2ad 100644 --- a/tools/unit-test-app/configs/flash_encryption +++ b/tools/unit-test-app/configs/flash_encryption @@ -1,3 +1,5 @@ +# This config is for ESP32 only (no ESP32-S2 flash encryption support yet) +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=spi_flash TEST_GROUPS=flash_encryption CONFIG_SECURE_FLASH_ENC_ENABLED=y diff --git a/tools/unit-test-app/configs/freertos_compliance b/tools/unit-test-app/configs/freertos_compliance index 57b1a2fd01..904701d97b 100644 --- a/tools/unit-test-app/configs/freertos_compliance +++ b/tools/unit-test-app/configs/freertos_compliance @@ -1,2 +1,4 @@ +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=driver esp32 esp_timer spi_flash CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE=y diff --git a/tools/unit-test-app/configs/freertos_compliance_s2 b/tools/unit-test-app/configs/freertos_compliance_s2 index 8f9acba041..afb0ccb316 100644 --- a/tools/unit-test-app/configs/freertos_compliance_s2 +++ b/tools/unit-test-app/configs/freertos_compliance_s2 @@ -1,3 +1,4 @@ +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32s2" TEST_COMPONENTS=driver esp32s2 esp_timer spi_flash CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE=y -CONFIG_IDF_TARGET="esp32s2" diff --git a/tools/unit-test-app/configs/libsodium b/tools/unit-test-app/configs/libsodium index af090a53cb..3c4b674cbf 100644 --- a/tools/unit-test-app/configs/libsodium +++ b/tools/unit-test-app/configs/libsodium @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=libsodium TEST_EXCLUDE_COMPONENTS=bt app_update CONFIG_UNITY_FREERTOS_STACK_SIZE=12288 \ No newline at end of file diff --git a/tools/unit-test-app/configs/psram b/tools/unit-test-app/configs/psram index 21b3fd090b..ec84981004 100644 --- a/tools/unit-test-app/configs/psram +++ b/tools/unit-test-app/configs/psram @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update driver esp32 esp_timer mbedtls spi_flash test_utils heap pthread soc CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 diff --git a/tools/unit-test-app/configs/psram_2 b/tools/unit-test-app/configs/psram_2 index 379dc923be..174744cf76 100644 --- a/tools/unit-test-app/configs/psram_2 +++ b/tools/unit-test-app/configs/psram_2 @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=esp32 esp_timer mbedtls spi_flash heap pthread soc CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 diff --git a/tools/unit-test-app/configs/psram_3 b/tools/unit-test-app/configs/psram_3 index 225297e469..af310d1ce7 100644 --- a/tools/unit-test-app/configs/psram_3 +++ b/tools/unit-test-app/configs/psram_3 @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=driver CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 diff --git a/tools/unit-test-app/configs/psram_8m b/tools/unit-test-app/configs/psram_8m index 62c9c859ce..9601748b42 100644 --- a/tools/unit-test-app/configs/psram_8m +++ b/tools/unit-test-app/configs/psram_8m @@ -1,6 +1,7 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=esp32 esp_timer CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_SPIRAM_BANKSWITCH_ENABLE=y CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 -CONFIG_SPIRAM_OCCUPY_NO_HOST=y \ No newline at end of file +CONFIG_SPIRAM_OCCUPY_NO_HOST=y diff --git a/tools/unit-test-app/configs/psram_hspi b/tools/unit-test-app/configs/psram_hspi index a7c288cc1e..5d0deaed4b 100644 --- a/tools/unit-test-app/configs/psram_hspi +++ b/tools/unit-test-app/configs/psram_hspi @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=esp32 TEST_GROUPS=psram_4m CONFIG_ESPTOOLPY_FLASHFREQ_80M=y diff --git a/tools/unit-test-app/configs/psram_vspi b/tools/unit-test-app/configs/psram_vspi index acd4979523..03dc373b88 100644 --- a/tools/unit-test-app/configs/psram_vspi +++ b/tools/unit-test-app/configs/psram_vspi @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=esp32 TEST_GROUPS=psram_4m CONFIG_ESPTOOLPY_FLASHFREQ_80M=y diff --git a/tools/unit-test-app/configs/release b/tools/unit-test-app/configs/release index 1dd4ef15e7..f4c743fcfe 100644 --- a/tools/unit-test-app/configs/release +++ b/tools/unit-test-app/configs/release @@ -1,3 +1,4 @@ +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=freertos esp32 esp_timer driver heap pthread soc spi_flash vfs CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y diff --git a/tools/unit-test-app/configs/release_2 b/tools/unit-test-app/configs/release_2 index 768e8f3222..ca84fa7721 100644 --- a/tools/unit-test-app/configs/release_2 +++ b/tools/unit-test-app/configs/release_2 @@ -1,3 +1,5 @@ +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_timer driver heap pthread soc spi_flash vfs test_utils CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y diff --git a/tools/unit-test-app/configs/release_2_s2 b/tools/unit-test-app/configs/release_2_s2 index 7ccd61a9d9..6ebab9229c 100644 --- a/tools/unit-test-app/configs/release_2_s2 +++ b/tools/unit-test-app/configs/release_2_s2 @@ -1,5 +1,6 @@ +# This config is split between targets since different component needs to be excluded (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32s2" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs test_utils CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y -CONFIG_IDF_TARGET="esp32s2" diff --git a/tools/unit-test-app/configs/release_s2 b/tools/unit-test-app/configs/release_s2 index 79166c0c58..2df70fef8c 100644 --- a/tools/unit-test-app/configs/release_s2 +++ b/tools/unit-test-app/configs/release_s2 @@ -1,5 +1,6 @@ +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32s2" TEST_COMPONENTS=freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y -CONFIG_IDF_TARGET="esp32s2" diff --git a/tools/unit-test-app/configs/single_core b/tools/unit-test-app/configs/single_core index 2b354bf3c8..5e9a50491a 100644 --- a/tools/unit-test-app/configs/single_core +++ b/tools/unit-test-app/configs/single_core @@ -1,3 +1,5 @@ +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32" TEST_COMPONENTS=freertos esp32 esp_timer driver heap pthread soc spi_flash vfs CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y diff --git a/tools/unit-test-app/configs/single_core_2 b/tools/unit-test-app/configs/single_core_2 index 77c0f887fb..13cf210d42 100644 --- a/tools/unit-test-app/configs/single_core_2 +++ b/tools/unit-test-app/configs/single_core_2 @@ -1,3 +1,5 @@ +# This config is split between targets since different component needs to be excluded (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_timer driver heap pthread soc spi_flash vfs test_utils CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y diff --git a/tools/unit-test-app/configs/single_core_2_s2 b/tools/unit-test-app/configs/single_core_2_s2 index ddd515ec53..bb52032af3 100644 --- a/tools/unit-test-app/configs/single_core_2_s2 +++ b/tools/unit-test-app/configs/single_core_2_s2 @@ -1,5 +1,6 @@ +# This config is split between targets since different component needs to be excluded (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32s2" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y CONFIG_ESP32_RTCDATA_IN_FAST_MEM=y -CONFIG_IDF_TARGET="esp32s2" diff --git a/tools/unit-test-app/configs/single_core_s2 b/tools/unit-test-app/configs/single_core_s2 index 71069137c5..9348707f10 100644 --- a/tools/unit-test-app/configs/single_core_s2 +++ b/tools/unit-test-app/configs/single_core_s2 @@ -1,5 +1,6 @@ +# This config is split between targets since different component needs to be included (esp32, esp32s2) +CONFIG_IDF_TARGET="esp32s2" TEST_COMPONENTS=freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs test_utils CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y CONFIG_ESP32_RTCDATA_IN_FAST_MEM=y -CONFIG_IDF_TARGET="esp32s2" diff --git a/tools/unit-test-app/configs/spi_flash_legacy b/tools/unit-test-app/configs/spi_flash_legacy index 3d5b1d9d2d..94be20d503 100644 --- a/tools/unit-test-app/configs/spi_flash_legacy +++ b/tools/unit-test-app/configs/spi_flash_legacy @@ -1,3 +1,4 @@ +# This config is for all targets TEST_COMPONENTS=spi_flash CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_SPI_FLASH_USE_LEGACY_IMPL=y diff --git a/tools/unit-test-app/configs/spi_flash_legacy_s2 b/tools/unit-test-app/configs/spi_flash_legacy_s2 deleted file mode 100644 index c222db3c92..0000000000 --- a/tools/unit-test-app/configs/spi_flash_legacy_s2 +++ /dev/null @@ -1,4 +0,0 @@ -TEST_COMPONENTS=spi_flash -CONFIG_ESP32_SPIRAM_SUPPORT=y -CONFIG_SPI_FLASH_USE_LEGACY_IMPL=y -CONFIG_IDF_TARGET="esp32s2" diff --git a/tools/unit-test-app/configs/test_utils b/tools/unit-test-app/configs/test_utils index 0246f5c2af..9d601796ef 100644 --- a/tools/unit-test-app/configs/test_utils +++ b/tools/unit-test-app/configs/test_utils @@ -1,3 +1,4 @@ +# This config is for all targets # The test is isolated as it requires particular memory layout TEST_COMPONENTS=test_utils CONFIG_ESP_IPC_TASK_STACK_SIZE=2048 diff --git a/tools/unit-test-app/configs/test_utils_psram b/tools/unit-test-app/configs/test_utils_psram index 739e8430f3..34d461b40f 100644 --- a/tools/unit-test-app/configs/test_utils_psram +++ b/tools/unit-test-app/configs/test_utils_psram @@ -1,3 +1,5 @@ +# This config is for esp32 only +CONFIG_IDF_TARGET="esp32" # The test is isolated as it requires particular memory layout TEST_COMPONENTS=test_utils CONFIG_ESP_IPC_TASK_STACK_SIZE=2048 diff --git a/tools/unit-test-app/configs/test_utils_s2 b/tools/unit-test-app/configs/test_utils_s2 deleted file mode 100644 index ce1cda2ff4..0000000000 --- a/tools/unit-test-app/configs/test_utils_s2 +++ /dev/null @@ -1,5 +0,0 @@ -# The test is isolated as it requires particular memory layout -TEST_COMPONENTS=test_utils -CONFIG_ESP_IPC_TASK_STACK_SIZE=2048 -CONFIG_IDF_TARGET="esp32s2" -