mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
device tests: some of them can be run on host (#6912)
* device tests: mock scripts + rename some tests to enable mock-testing them * move symbol
This commit is contained in:
@ -174,7 +174,7 @@ void control_c (int sig)
|
||||
int main (int argc, char* const argv [])
|
||||
{
|
||||
bool fast = false;
|
||||
bool blocking_uart = false;
|
||||
blocking_uart = false; // global
|
||||
|
||||
signal(SIGINT, control_c);
|
||||
if (geteuid() == 0)
|
||||
|
@ -39,6 +39,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
bool blocking_uart = true; // system default
|
||||
|
||||
static int s_uart_debug_nr = UART1;
|
||||
|
||||
static uart_t *UART[2] = { NULL, NULL };
|
||||
@ -190,6 +192,13 @@ uart_read(uart_t* uart, char* userbuffer, size_t usersize)
|
||||
if(uart == NULL || !uart->rx_enabled)
|
||||
return 0;
|
||||
|
||||
if (!blocking_uart)
|
||||
{
|
||||
char c;
|
||||
if (read(0, &c, 1) == 1)
|
||||
uart_new_data(0, c);
|
||||
}
|
||||
|
||||
size_t ret = 0;
|
||||
while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
|
||||
{
|
||||
|
@ -104,12 +104,14 @@ extern "C" {
|
||||
#endif
|
||||
int ets_printf (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
#define os_printf_plus printf
|
||||
#define ets_vsnprintf vsnprintf
|
||||
|
||||
int mockverbose (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
extern const char* host_interface; // cmdline parameter
|
||||
extern bool serial_timestamp;
|
||||
extern int mock_port_shifter;
|
||||
extern bool blocking_uart;
|
||||
|
||||
#define NO_GLOBAL_BINDING 0xffffffff
|
||||
extern uint32_t global_ipv4_netfmt; // selected interface addresse to bind to
|
||||
|
Reference in New Issue
Block a user