diff --git a/components/driver/test_apps/.build-test-rules.yml b/components/driver/test_apps/.build-test-rules.yml index 213bd2d97fc2..24254e6e885f 100644 --- a/components/driver/test_apps/.build-test-rules.yml +++ b/components/driver/test_apps/.build-test-rules.yml @@ -31,6 +31,11 @@ components/driver/test_apps/legacy_i2c_driver: reason: lack of runner depends_filepatterns: - components/driver/i2c/** + # Following dependency is needed because they might increase lazy installed memory + # that can cause sleep retention memory leak check failed. + - components/ieee802154/** + - components/esp_coex/** + - components/esp_phy/** components/driver/test_apps/legacy_mcpwm_driver: disable: diff --git a/components/driver/test_apps/legacy_i2c_driver/main/test_app_main.c b/components/driver/test_apps/legacy_i2c_driver/main/test_app_main.c index ea8659d5e1b9..f5465e57caf5 100644 --- a/components/driver/test_apps/legacy_i2c_driver/main/test_app_main.c +++ b/components/driver/test_apps/legacy_i2c_driver/main/test_app_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,10 +8,15 @@ #include "unity_test_runner.h" #include "unity_test_utils_memory.h" #include "esp_heap_caps.h" +#include "sdkconfig.h" // Some resources are lazy allocated in I2C driver, so we reserved this threshold when checking memory leak // A better way to check a potential memory leak is running a same case by twice, for the second time, the memory usage delta should be zero -#define LEAKS (900) +#if CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP +#define LEAKS (1200) // For 802154 usage +#else +#define LEAKS (400) +#endif void setUp(void) { diff --git a/components/esp_driver_i2c/test_apps/.build-test-rules.yml b/components/esp_driver_i2c/test_apps/.build-test-rules.yml index 074e8796e9f9..19b812ef61f9 100644 --- a/components/esp_driver_i2c/test_apps/.build-test-rules.yml +++ b/components/esp_driver_i2c/test_apps/.build-test-rules.yml @@ -9,3 +9,8 @@ components/esp_driver_i2c/test_apps/i2c_test_apps: reason: lack of runners depends_components: - esp_driver_i2c + # Following dependency is needed because they might increase lazy installed memory + # that can cause sleep retention memory leak check failed. + - components/ieee802154/** + - components/esp_coex/** + - components/esp_phy/** diff --git a/components/esp_driver_i2c/test_apps/i2c_test_apps/main/test_app_main.c b/components/esp_driver_i2c/test_apps/i2c_test_apps/main/test_app_main.c index eb605f33f2f5..f5465e57caf5 100644 --- a/components/esp_driver_i2c/test_apps/i2c_test_apps/main/test_app_main.c +++ b/components/esp_driver_i2c/test_apps/i2c_test_apps/main/test_app_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,10 +8,15 @@ #include "unity_test_runner.h" #include "unity_test_utils_memory.h" #include "esp_heap_caps.h" +#include "sdkconfig.h" // Some resources are lazy allocated in I2C driver, so we reserved this threshold when checking memory leak // A better way to check a potential memory leak is running a same case by twice, for the second time, the memory usage delta should be zero -#define LEAKS (1000) +#if CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP +#define LEAKS (1200) // For 802154 usage +#else +#define LEAKS (400) +#endif void setUp(void) {