Skip to content

Commit

Permalink
ci(test): Fix PSRAM test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Feb 22, 2025
1 parent 003db9e commit 543a647
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
24 changes: 24 additions & 0 deletions tests/validation/psram/diagram.esp32s3.json
Original file line number Diff line number Diff line change
@@ -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",
""
]
]
}
16 changes: 15 additions & 1 deletion tests/validation/psram/psram.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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();
}
Expand Down

0 comments on commit 543a647

Please sign in to comment.