test(console): add tests for console with vfs disabled

This commit is contained in:
Marius Vikhammer 2024-06-12 11:52:20 +08:00
parent 9862ae280f
commit 69ca6e49a7
7 changed files with 16 additions and 2 deletions

View File

@ -7,6 +7,7 @@ components/esp_system/test_apps/cache_panic:
components/esp_system/test_apps/console:
disable:
- if: CONFIG_NAME == "serial_jtag_only" and SOC_USB_SERIAL_JTAG_SUPPORTED != 1
- if: CONFIG_NAME == "serial_jtag_only_no_vfs" and SOC_USB_SERIAL_JTAG_SUPPORTED != 1
components/esp_system/test_apps/esp_system_unity_tests:
disable:

View File

@ -38,9 +38,10 @@ def test_esp_system_console_no_output_uart(dut: Dut) -> None:
@pytest.mark.usb_serial_jtag
@pytest.mark.parametrize(
'port, config',
'port, flash_port, config',
[
pytest.param('/dev/serial_ports/ttyACM-esp32', 'serial_jtag_only', marks=JTAG_SERIAL_MARKS),
pytest.param('/dev/serial_ports/ttyACM-esp32', '/dev/serial_ports/ttyUSB-esp32', 'serial_jtag_only', marks=JTAG_SERIAL_MARKS),
pytest.param('/dev/serial_ports/ttyACM-esp32', '/dev/serial_ports/ttyUSB-esp32', 'serial_jtag_only_no_vfs', marks=JTAG_SERIAL_MARKS),
],
indirect=True,
)

View File

@ -1 +1,2 @@
CONFIG_ESP_CONSOLE_NONE=y
CONFIG_VFS_SUPPORT_IO=y

View File

@ -0,0 +1,2 @@
CONFIG_ESP_CONSOLE_NONE=y
CONFIG_VFS_SUPPORT_IO=n

View File

@ -1,3 +1,4 @@
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
# Disabled due to semihosting issue IDF-9574
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=n
CONFIG_VFS_SUPPORT_IO=y

View File

@ -0,0 +1,4 @@
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
# Disabled due to semihosting issue IDF-9574
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=n
CONFIG_VFS_SUPPORT_IO=n

View File

@ -29,6 +29,7 @@ static int syscall_not_implemented_aborts(void)
ssize_t _write_r_console(struct _reent *r, int fd, const void * data, size_t size)
{
#if !CONFIG_ESP_CONSOLE_NONE
const char* cdata = (const char*) data;
if (fd == STDOUT_FILENO || fd == STDERR_FILENO) {
for (size_t i = 0; i < size; ++i) {
@ -36,12 +37,14 @@ ssize_t _write_r_console(struct _reent *r, int fd, const void * data, size_t siz
}
return size;
}
#endif //!CONFIG_ESP_CONSOLE_NONE
__errno_r(r) = EBADF;
return -1;
}
ssize_t _read_r_console(struct _reent *r, int fd, void * data, size_t size)
{
#if !CONFIG_ESP_CONSOLE_NONE
char* cdata = (char*) data;
if (fd == STDIN_FILENO) {
size_t received;
@ -57,6 +60,7 @@ ssize_t _read_r_console(struct _reent *r, int fd, void * data, size_t size)
}
return received;
}
#endif //!CONFIG_ESP_CONSOLE_NONE
__errno_r(r) = EBADF;
return -1;
}