diff --git a/tests/validation/psram/diagram.esp32s3.json b/tests/validation/psram/diagram.esp32s3.json new file mode 100644 index 00000000000..837ff1eed33 --- /dev/null +++ b/tests/validation/psram/diagram.esp32s3.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "author": "lucasssvaz", + "editor": "wokwi", + "parts": [ + { + "type": "board-esp32-s3-devkitc-1", + "id": "esp", + "attrs": { "psramType": "octal" } + } + ], + "connections": [ + [ + "esp:TX", + "$serialMonitor:RX", + "" + ], + [ + "esp:RX", + "$serialMonitor:TX", + "" + ] + ] +} diff --git a/tests/validation/psram/psram.ino b/tests/validation/psram/psram.ino index 1304fe85cc1..a53be84fd68 100644 --- a/tests/validation/psram/psram.ino +++ b/tests/validation/psram/psram.ino @@ -4,6 +4,12 @@ #define MAX_TEST_SIZE 512 * 1024 // 512KB void *buf = NULL; +uint32_t psram_size = 0; + +void psram_found(void) { + psram_size = ESP.getPsramSize(); + TEST_ASSERT_TRUE(psram_size > 0); +} void test_malloc_success(void) { buf = ps_malloc(MAX_TEST_SIZE); @@ -96,6 +102,13 @@ void setup() { } UNITY_BEGIN(); + RUN_TEST(psram_found); + + if (psram_size == 0) { + UNITY_END(); + return; + } + RUN_TEST(test_malloc_success); RUN_TEST(test_malloc_fail); RUN_TEST(test_calloc_success); @@ -104,7 +117,8 @@ void setup() { RUN_TEST(test_memset_all_zeroes); RUN_TEST(test_memset_all_ones); RUN_TEST(test_memset_alternating); - RUN_TEST(test_memset_random); + //This test is disabled because it takes too long to run on some wokwi boards + //RUN_TEST(test_memset_random); RUN_TEST(test_memcpy); UNITY_END(); }