From fa13b31dcae077dd14f9073d610df043a6965301 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 2 May 2024 16:42:01 +0200 Subject: [PATCH] ci(sdspi): clean up newlib memory, reset between tests Two changes to make the tests less susceptible to random failures: - Free up newlib memory to not have false-positive memory leaks due to lazy allocations in reent structure - Reset between tests, so that one failing test doesn't cause subsequent tests to fail Both changes are already applied to esp_driver_sdmmc test app. --- .../esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c | 2 ++ components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c b/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c index 274579059d..b165025bc9 100644 --- a/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c +++ b/components/esp_driver_sdspi/test_apps/sdspi/main/test_app_main.c @@ -13,11 +13,13 @@ void setUp(void) { + printf("%s", ""); /* sneakily lazy-allocate the reent structure for this test task */ unity_utils_record_free_mem(); } void tearDown(void) { + esp_reent_cleanup(); unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD); } diff --git a/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py b/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py index ce8ced4bd2..dbc425b34b 100644 --- a/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py +++ b/components/esp_driver_sdspi/test_apps/sdspi/pytest_sdspi.py @@ -10,4 +10,4 @@ from pytest_embedded_idf import IdfDut @pytest.mark.esp32p4 @pytest.mark.sdcard_spimode def test_sdspi(dut: IdfDut) -> None: - dut.run_all_single_board_cases() + dut.run_all_single_board_cases(reset=True)