diff --git a/components/heap/test_apps/pytest_heap.py b/components/heap/test_apps/pytest_heap.py index 4ba00be49d..8c43daa550 100644 --- a/components/heap/test_apps/pytest_heap.py +++ b/components/heap/test_apps/pytest_heap.py @@ -7,7 +7,60 @@ from pytest_embedded import Dut @pytest.mark.generic @pytest.mark.supported_targets +@pytest.mark.parametrize( + 'config', + [ + 'no_poisoning', + 'light_poisoning', + 'comprehensive_poisoning' + ] +) +def test_heap_poisoning(dut: Dut) -> None: + dut.expect_exact('Press ENTER to see the list of tests') + dut.write('![ignore]') + dut.expect_unity_test_output(timeout=300) + + +@pytest.mark.generic +@pytest.mark.esp32 +@pytest.mark.esp32s2 +@pytest.mark.esp32s3 +@pytest.mark.parametrize( + 'config', + [ + 'psram', + 'psram_all_ext' + ] +) def test_heap(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') - dut.write('*') + dut.write('![ignore]') + dut.expect_unity_test_output(timeout=300) + + +@pytest.mark.generic +@pytest.mark.esp32 +@pytest.mark.parametrize( + 'config', + [ + 'abort_alloc_fail' + ] +) +def test_heap_abort_on_alloc_failure(dut: Dut) -> None: + dut.expect_exact('Press ENTER to see the list of tests') + dut.write('"When enabled, allocation operation failure generates an abort"') + dut.expect('Backtrace: ') + + +@pytest.mark.generic +@pytest.mark.esp32 +@pytest.mark.parametrize( + 'config', + [ + '8bit_access' + ] +) +def test_heap_8bit_access(dut: Dut) -> None: + dut.expect_exact('Press ENTER to see the list of tests') + dut.write('"IRAM_8BIT capability test"') dut.expect_unity_test_output(timeout=300) diff --git a/components/heap/test_apps/sdkconfig.ci.8bit_access b/components/heap/test_apps/sdkconfig.ci.8bit_access new file mode 100644 index 0000000000..c8710c4043 --- /dev/null +++ b/components/heap/test_apps/sdkconfig.ci.8bit_access @@ -0,0 +1,2 @@ +CONFIG_FREERTOS_UNICORE=y +CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY=y diff --git a/components/heap/test_apps/sdkconfig.ci.abort_alloc_fail b/components/heap/test_apps/sdkconfig.ci.abort_alloc_fail new file mode 100644 index 0000000000..1dd2c31d33 --- /dev/null +++ b/components/heap/test_apps/sdkconfig.ci.abort_alloc_fail @@ -0,0 +1 @@ +CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS=y diff --git a/components/heap/test_apps/sdkconfig.ci.comprehensive_poisoning b/components/heap/test_apps/sdkconfig.ci.comprehensive_poisoning new file mode 100644 index 0000000000..864e4213dd --- /dev/null +++ b/components/heap/test_apps/sdkconfig.ci.comprehensive_poisoning @@ -0,0 +1,3 @@ +CONFIG_HEAP_POISONING_DISABLED=n +CONFIG_HEAP_POISONING_LIGHT=n +CONFIG_HEAP_POISONING_COMPREHENSIVE=y diff --git a/components/heap/test_apps/sdkconfig.ci.light_poisoning b/components/heap/test_apps/sdkconfig.ci.light_poisoning new file mode 100644 index 0000000000..0e2c3bc1d2 --- /dev/null +++ b/components/heap/test_apps/sdkconfig.ci.light_poisoning @@ -0,0 +1,3 @@ +CONFIG_HEAP_POISONING_DISABLED=n +CONFIG_HEAP_POISONING_LIGHT=y +CONFIG_HEAP_POISONING_COMPREHENSIVE=n diff --git a/components/heap/test_apps/sdkconfig.ci.no_poisoning b/components/heap/test_apps/sdkconfig.ci.no_poisoning new file mode 100644 index 0000000000..657a760928 --- /dev/null +++ b/components/heap/test_apps/sdkconfig.ci.no_poisoning @@ -0,0 +1,3 @@ +CONFIG_HEAP_POISONING_DISABLED=y +CONFIG_HEAP_POISONING_LIGHT=n +CONFIG_HEAP_POISONING_COMPREHENSIVE=n diff --git a/components/heap/test_apps/sdkconfig.ci.psram b/components/heap/test_apps/sdkconfig.ci.psram new file mode 100644 index 0000000000..cc641ea603 --- /dev/null +++ b/components/heap/test_apps/sdkconfig.ci.psram @@ -0,0 +1 @@ +CONFIG_SPIRAM=y diff --git a/components/heap/test_apps/sdkconfig.ci.psram_all_ext b/components/heap/test_apps/sdkconfig.ci.psram_all_ext new file mode 100644 index 0000000000..db575808cf --- /dev/null +++ b/components/heap/test_apps/sdkconfig.ci.psram_all_ext @@ -0,0 +1,2 @@ +CONFIG_SPIRAM=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0