From a8bcf67cb5507fed2b2db10716a59dd3edde0838 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 29 Feb 2024 14:43:38 +0800 Subject: [PATCH] ci: enable esp_pm pytest for esp32p4 --- components/esp_pm/test_apps/.build-test-rules.yml | 8 ++++---- components/esp_pm/test_apps/esp_pm/main/test_pm.c | 6 +++++- components/esp_pm/test_apps/esp_pm/pytest_esp_pm.py | 2 -- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/esp_pm/test_apps/.build-test-rules.yml b/components/esp_pm/test_apps/.build-test-rules.yml index fdac75267f..4413898e4d 100644 --- a/components/esp_pm/test_apps/.build-test-rules.yml +++ b/components/esp_pm/test_apps/.build-test-rules.yml @@ -1,7 +1,7 @@ # Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps components/esp_pm/test_apps: - disable_test: - - if: IDF_TARGET == "esp32p4" - temporary: true - reason: test not pass, should be re-enable # TODO: IDF-8976 + enable: + - if: INCLUDE_DEFAULT == 1 + depends_components: + - esp_pm diff --git a/components/esp_pm/test_apps/esp_pm/main/test_pm.c b/components/esp_pm/test_apps/esp_pm/main/test_pm.c index 48f89ffb4f..d65bf44c0f 100644 --- a/components/esp_pm/test_apps/esp_pm/main/test_pm.c +++ b/components/esp_pm/test_apps/esp_pm/main/test_pm.c @@ -69,6 +69,8 @@ static const int test_freqs[] = {32, CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, 64, 48, 32 #elif CONFIG_IDF_TARGET_ESP32C2 static const int test_freqs[] = {CONFIG_XTAL_FREQ, CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, 80, CONFIG_XTAL_FREQ, 80, CONFIG_XTAL_FREQ / 2, CONFIG_XTAL_FREQ}; // C2 xtal has 40/26MHz option +#elif CONFIG_IDF_TARGET_ESP32P4 +static const int test_freqs[] = {40, CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, 90, 40, 90, 10, 90, 20, 40, 360, 90, 180, 90, 40}; #else static const int test_freqs[] = {240, 40, 160, 240, 80, 40, 240, 40, 80, 10, 80, 20, 40}; #endif @@ -154,7 +156,7 @@ TEST_CASE("Automatic light occurs when tasks are suspended", "[pm]") const int us_per_tick = 1 * portTICK_PERIOD_MS * 1000; printf("%d %d\n", ticks_to_delay * us_per_tick, timer_diff_us); - TEST_ASSERT(timer_diff_us < ticks_to_delay * us_per_tick); + TEST_ASSERT(timer_diff_us <= ticks_to_delay * us_per_tick); } light_sleep_disable(); @@ -239,6 +241,7 @@ TEST_CASE("Can wake up from automatic light sleep by GPIO", "[pm][ignore]") #endif //!TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2, ESP32S3) #endif //CONFIG_ULP_COPROC_TYPE_FSM +#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32P4) //TODO: IDF-9628 typedef struct { int delay_us; int result; @@ -292,6 +295,7 @@ TEST_CASE("vTaskDelay duration is correct with light sleep enabled", "[pm]") light_sleep_disable(); } +#endif /* This test is similar to the one in test_esp_timer.c, but since we can't use * ref_clock, this test uses RTC clock for timing. Also enables automatic diff --git a/components/esp_pm/test_apps/esp_pm/pytest_esp_pm.py b/components/esp_pm/test_apps/esp_pm/pytest_esp_pm.py index 9d6fb7ad88..466fbef64e 100644 --- a/components/esp_pm/test_apps/esp_pm/pytest_esp_pm.py +++ b/components/esp_pm/test_apps/esp_pm/pytest_esp_pm.py @@ -1,11 +1,9 @@ # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import pytest from pytest_embedded import Dut -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='esp32p4 support TBD') # TODO: IDF-8976 @pytest.mark.generic @pytest.mark.supported_targets @pytest.mark.parametrize('config', [