diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f6b291178..b63e94037c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,9 +19,9 @@ repos: files: 'pytest_.*\.py$' require_serial: true additional_dependencies: - - pytest-embedded-idf[serial]~=1.14 - - pytest-embedded-jtag~=1.14 - - pytest-embedded-qemu~=1.14 + - pytest-embedded-idf[serial]~=1.16 + - pytest-embedded-jtag~=1.16 + - pytest-embedded-qemu~=1.16 - pytest-ignore-test-results~=0.3 - pytest-rerunfailures - pytest-timeout diff --git a/components/esp_driver_twai/test_apps/twaifd_test/main/test_app_main.c b/components/esp_driver_twai/test_apps/twaifd_test/main/test_app_main.c index 229f8d8dcd..8c66fa4030 100644 --- a/components/esp_driver_twai/test_apps/twaifd_test/main/test_app_main.c +++ b/components/esp_driver_twai/test_apps/twaifd_test/main/test_app_main.c @@ -9,7 +9,8 @@ #include "unity_test_utils_memory.h" #include "esp_heap_caps.h" -#define LEAKS (200) +// lazy install of mutex and pm_lock occupied memorys +#define LEAKS (250) void setUp(void) { diff --git a/components/esp_driver_twai/test_apps/twaifd_test/main/test_twaifd.c b/components/esp_driver_twai/test_apps/twaifd_test/main/test_twaifd.c index 272f5d48c1..282c798adb 100644 --- a/components/esp_driver_twai/test_apps/twaifd_test/main/test_twaifd.c +++ b/components/esp_driver_twai/test_apps/twaifd_test/main/test_twaifd.c @@ -173,7 +173,9 @@ TEST_CASE("twai transmit stop resume (loopback)", "[TWAI]") TEST_ESP_OK(twai_node_enable(node_hdl)); //waiting pkg receive finish - while (rx_frame.buffer < recv_pkg_ptr + TEST_TRANS_LEN); + while (rx_frame.buffer < recv_pkg_ptr + TEST_TRANS_LEN) { + vTaskDelay(1); + } free(tx_msgs); // check if pkg receive correct diff --git a/components/esp_driver_twai/test_apps/twaifd_test/pytest_driver_twai.py b/components/esp_driver_twai/test_apps/twaifd_test/pytest_driver_twai.py new file mode 100644 index 0000000000..bd511bd6b8 --- /dev/null +++ b/components/esp_driver_twai/test_apps/twaifd_test/pytest_driver_twai.py @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 + +import pytest +from pytest_embedded import Dut +from pytest_embedded_idf.utils import idf_parametrize +from pytest_embedded_idf.utils import soc_filtered_targets + + +@pytest.mark.generic +@pytest.mark.parametrize('config', ['release'], indirect=True) +@idf_parametrize('target', soc_filtered_targets('SOC_TWAI_SUPPORT_FD == 1'), indirect=['target']) +def test_driver_twai_loopbk(dut: Dut) -> None: + dut.run_all_single_board_cases(reset=True) diff --git a/components/esp_driver_twai/test_apps/twaifd_test/sdkconfig.ci.release b/components/esp_driver_twai/test_apps/twaifd_test/sdkconfig.ci.release new file mode 100644 index 0000000000..1a87ebbb4a --- /dev/null +++ b/components/esp_driver_twai/test_apps/twaifd_test/sdkconfig.ci.release @@ -0,0 +1,7 @@ +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y +CONFIG_PM_DFS_INIT_AUTO=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y