forked from platformio/platformio-core
Update unit testing support for mbed framework
- Take into account Mbed OS6 API changes - RawSerial is used with Mbed OS 5 since Serial doesn't support putc with baremetal profile
This commit is contained in:
2
examples
2
examples
Submodule examples updated: c3f6d1f17e...f0f4e0971b
@ -25,33 +25,33 @@ TRANSPORT_OPTIONS = {
|
||||
"arduino": {
|
||||
"include": "#include <Arduino.h>",
|
||||
"object": "",
|
||||
"putchar": "Serial.write(c)",
|
||||
"flush": "Serial.flush()",
|
||||
"begin": "Serial.begin($baudrate)",
|
||||
"end": "Serial.end()",
|
||||
"putchar": "Serial.write(c);",
|
||||
"flush": "Serial.flush();",
|
||||
"begin": "Serial.begin($baudrate);",
|
||||
"end": "Serial.end();",
|
||||
"language": "cpp",
|
||||
},
|
||||
"mbed": {
|
||||
"include": "#include <mbed.h>",
|
||||
"object": "Serial pc(USBTX, USBRX);",
|
||||
"putchar": "pc.putc(c)",
|
||||
"object": "#if MBED_MAJOR_VERSION == 6\nUnbufferedSerial pc(USBTX, USBRX);\n#else\nRawSerial pc(USBTX, USBRX);\n#endif",
|
||||
"putchar": "#if MBED_MAJOR_VERSION == 6\npc.write(&c, 1);\n#else\npc.putc(c);\n#endif",
|
||||
"flush": "",
|
||||
"begin": "pc.baud($baudrate)",
|
||||
"begin": "pc.baud($baudrate);",
|
||||
"end": "",
|
||||
"language": "cpp",
|
||||
},
|
||||
"espidf": {
|
||||
"include": "#include <stdio.h>",
|
||||
"object": "",
|
||||
"putchar": "putchar(c)",
|
||||
"flush": "fflush(stdout)",
|
||||
"putchar": "putchar(c);",
|
||||
"flush": "fflush(stdout);",
|
||||
"begin": "",
|
||||
"end": "",
|
||||
},
|
||||
"zephyr": {
|
||||
"include": "#include <sys/printk.h>",
|
||||
"object": "",
|
||||
"putchar": 'printk("%c", c)',
|
||||
"putchar": 'printk("%c", c);',
|
||||
"flush": "",
|
||||
"begin": "",
|
||||
"end": "",
|
||||
@ -59,18 +59,18 @@ TRANSPORT_OPTIONS = {
|
||||
"native": {
|
||||
"include": "#include <stdio.h>",
|
||||
"object": "",
|
||||
"putchar": "putchar(c)",
|
||||
"flush": "fflush(stdout)",
|
||||
"putchar": "putchar(c);",
|
||||
"flush": "fflush(stdout);",
|
||||
"begin": "",
|
||||
"end": "",
|
||||
},
|
||||
"custom": {
|
||||
"include": '#include "unittest_transport.h"',
|
||||
"object": "",
|
||||
"putchar": "unittest_uart_putchar(c)",
|
||||
"flush": "unittest_uart_flush()",
|
||||
"begin": "unittest_uart_begin()",
|
||||
"end": "unittest_uart_end()",
|
||||
"putchar": "unittest_uart_putchar(c);",
|
||||
"flush": "unittest_uart_flush();",
|
||||
"begin": "unittest_uart_begin();",
|
||||
"end": "unittest_uart_end();",
|
||||
"language": "cpp",
|
||||
},
|
||||
}
|
||||
@ -174,22 +174,22 @@ class TestProcessorBase(object):
|
||||
"void output_start(unsigned int baudrate)",
|
||||
"#endif",
|
||||
"{",
|
||||
" $begin;",
|
||||
" $begin",
|
||||
"}",
|
||||
"",
|
||||
"void output_char(int c)",
|
||||
"{",
|
||||
" $putchar;",
|
||||
" $putchar",
|
||||
"}",
|
||||
"",
|
||||
"void output_flush(void)",
|
||||
"{",
|
||||
" $flush;",
|
||||
" $flush",
|
||||
"}",
|
||||
"",
|
||||
"void output_complete(void)",
|
||||
"{",
|
||||
" $end;",
|
||||
" $end",
|
||||
"}",
|
||||
]
|
||||
)
|
||||
|
Reference in New Issue
Block a user