From 4ab8f00b47c8d4be74dc622fe0dde0b2519374ec Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Wed, 13 Jul 2022 18:41:55 +0800 Subject: [PATCH] ci: setup 26mhz esp32c2 runner --- .gitlab/ci/target-test.yml | 29 +++++++++++++++++++ components/esp_timer/test/test_esp_timer.c | 5 ++++ .../test/test_esp_timer_light_sleep.c | 6 +++- components/esp_timer/test/test_ets_timer.c | 5 ++++ tools/ci/check_copyright_ignore.txt | 3 -- tools/unit-test-app/configs/default_c2_26mhz | 5 ++++ tools/unit-test-app/unit_test.py | 2 ++ 7 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 tools/unit-test-app/configs/default_c2_26mhz diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index 2fc474bf7c..317aa03c89 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -70,6 +70,14 @@ example_test_pytest_esp32c2_generic: - build_pytest_examples_esp32c2 tags: [ esp32c2, generic, xtal_40mhz ] +example_test_pytest_esp32c2_26mhz: + extends: + - .pytest_examples_dir_template + - .rules:test:example_test-esp32c2 + needs: + - build_pytest_examples_esp32c2 + tags: [ esp32c2, xtal_26mhz ] + example_test_pytest_esp32c3_generic: extends: - .pytest_examples_dir_template @@ -340,6 +348,14 @@ test_app_test_pytest_esp32c2_generic: - build_pytest_test_apps_esp32c2 tags: [ esp32c2, generic, xtal_40mhz ] +test_app_test_pytest_esp32c2_26mhz: + extends: + - .pytest_test_apps_dir_template + - .rules:test:custom_test-esp32c2 + needs: + - build_pytest_test_apps_esp32c2 + tags: [ esp32c2, xtal_26mhz ] + test_app_test_pytest_esp32c3_generic: extends: - .pytest_test_apps_dir_template @@ -654,6 +670,12 @@ test_app_test_esp32c2_generic: - Example_GENERIC - xtal_40mhz +test_app_test_esp32c2_26mhz: + extends: .test_app_esp32c2_template + tags: + - ESP32C2 + - xtal_26mhz + test_app_test_005: extends: .test_app_esp32c3_template tags: @@ -923,6 +945,13 @@ UT_C2: - UT_T1_1 - xtal_40mhz +UT_C2_26M: + extends: .unit_test_esp32c2_template + tags: + - ESP32C2_IDF + - UT_T1_1 + - xtal_26mhz + UT_C3: extends: .unit_test_esp32c3_template parallel: 31 diff --git a/components/esp_timer/test/test_esp_timer.c b/components/esp_timer/test/test_esp_timer.c index 18bca2b54f..bb24c44ac4 100644 --- a/components/esp_timer/test/test_esp_timer.c +++ b/components/esp_timer/test/test_esp_timer.c @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include #include diff --git a/components/esp_timer/test/test_esp_timer_light_sleep.c b/components/esp_timer/test/test_esp_timer_light_sleep.c index dc5cacdf3d..b95c0d25ad 100644 --- a/components/esp_timer/test/test_esp_timer_light_sleep.c +++ b/components/esp_timer/test/test_esp_timer_light_sleep.c @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include #include @@ -8,7 +13,6 @@ #include "esp_rom_sys.h" #include "esp_sleep.h" - static void timer_cb1(void *arg) { ++*((int*) arg); diff --git a/components/esp_timer/test/test_ets_timer.c b/components/esp_timer/test/test_ets_timer.c index a2e495a3fe..b72e4fdf9e 100644 --- a/components/esp_timer/test/test_ets_timer.c +++ b/components/esp_timer/test/test_ets_timer.c @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include #include diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 631ba90633..35093eec49 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -671,9 +671,6 @@ components/esp_system/test_eh_frame_parser/eh_frame_parser_impl.h components/esp_system/test_eh_frame_parser/esp_private/panic_internal.h components/esp_system/test_eh_frame_parser/linker.ld components/esp_system/ubsan.c -components/esp_timer/test/test_esp_timer.c -components/esp_timer/test/test_esp_timer_light_sleep.c -components/esp_timer/test/test_ets_timer.c components/esp_wifi/include/esp_mesh_internal.h components/esp_wifi/include/esp_private/esp_wifi_types_private.h components/esp_wifi/include/esp_private/wifi_types.h diff --git a/tools/unit-test-app/configs/default_c2_26mhz b/tools/unit-test-app/configs/default_c2_26mhz new file mode 100644 index 0000000000..25a0be166f --- /dev/null +++ b/tools/unit-test-app/configs/default_c2_26mhz @@ -0,0 +1,5 @@ +# This config is split between targets since different component needs to be included +CONFIG_IDF_TARGET="esp32c2" +CONFIG_ESP32C2_XTAL_FREQ_26=y + +TEST_COMPONENTS=esp_timer diff --git a/tools/unit-test-app/unit_test.py b/tools/unit-test-app/unit_test.py index 834f263276..e1f2e8a5d7 100755 --- a/tools/unit-test-app/unit_test.py +++ b/tools/unit-test-app/unit_test.py @@ -297,6 +297,7 @@ def run_unit_test_cases(env, extra_data): for ut_config in case_config: Utility.console_log('Running unit test for config: ' + ut_config, 'O') + # Get the console baudrate from the sdkconfig _app = ttfw_idf.UT(app_path=UT_APP_PATH, config_name=ut_config, target=env.default_dut_cls.TARGET) baud = _app.get_sdkconfig_config_value('CONFIG_ESP_CONSOLE_UART_BAUDRATE') if baud is None: @@ -306,6 +307,7 @@ def run_unit_test_cases(env, extra_data): baud = int(baud, 10) if isinstance(baud, str) else baud Utility.console_log('Console baudrate is {}'.format(baud)) + # Get the DUT with specified baudrate dut = env.get_dut('unit-test-app', app_path=UT_APP_PATH, app_config_name=ut_config, allow_dut_exception=True, baudrate=baud) if len(case_config[ut_config]) > 0: