mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 21:24:32 +02:00
tests: panic: make 'get_test_name' work without VFS, add echo
When vfs component is not added to the build, bare minimum syscalls are provided by newlib component. These syscalls currently don't perform CR/LF translation. This commit makes the 'get_test_name' function work with minimal syscalls and also adds echo, so that the user sees what they type.
This commit is contained in:
@@ -194,12 +194,17 @@ static const char* get_test_name(void)
|
|||||||
c = getchar();
|
c = getchar();
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
vTaskDelay(pdMS_TO_TICKS(10));
|
vTaskDelay(pdMS_TO_TICKS(10));
|
||||||
} else if (c == '\r') {
|
} else if ((c == '\r' || c == '\n') && p != test_name_str) {
|
||||||
continue;
|
/* terminate the line */
|
||||||
} else if (c == '\n') {
|
puts("\n\r");
|
||||||
|
fflush(stdout);
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
/* echo the received character */
|
||||||
|
putchar(c);
|
||||||
|
fflush(stdout);
|
||||||
|
/* and save it */
|
||||||
*p = c;
|
*p = c;
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user