Skip to content

Commit

Permalink
add parameter for test qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdadh committed Jul 1, 2021
1 parent 794141f commit c33ef38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 5 additions & 7 deletions apps/microtvm/zephyr/aot_demo/src/zephyr_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,11 @@ uint32_t TVMPlatformWriteSerial(const char* data, uint32_t size) {
void TVMPlatformUARTInit() {
// Claim console device.
g_microtvm_uart = device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_console)));
const struct uart_config config = {
.baudrate = 115200,
.parity = UART_CFG_PARITY_NONE,
.stop_bits = UART_CFG_STOP_BITS_1,
.data_bits = UART_CFG_DATA_BITS_8,
.flow_ctrl = UART_CFG_FLOW_CTRL_NONE
};
const struct uart_config config = {.baudrate = 115200,
.parity = UART_CFG_PARITY_NONE,
.stop_bits = UART_CFG_STOP_BITS_1,
.data_bits = UART_CFG_DATA_BITS_8,
.flow_ctrl = UART_CFG_FLOW_CTRL_NONE};
uart_configure(g_microtvm_uart, &config);
uart_rx_init(&uart_rx_rbuf, g_microtvm_uart);
}
7 changes: 6 additions & 1 deletion tests/micro/zephyr/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ def pytest_addoption(parser):


def pytest_generate_tests(metafunc):
if "platform" in metafunc.fixturenames:
parametrized_args = [
arg.strip()
for mark in metafunc.definition.iter_markers("parametrize")
for arg in mark.args[0].split(",")
]
if "platform" not in parametrized_args:
metafunc.parametrize("platform", metafunc.config.getoption("microtvm_platforms").split(","))


Expand Down
1 change: 1 addition & 0 deletions tests/micro/zephyr/test_zephyr_aot.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def test_tflite(platform, west_cmd, skip_build, tvm_debug):
assert result == 8


@pytest.mark.parametrize("platform", ["host", "mps2_an521"])
def test_qemu_make_fail(platform, west_cmd, skip_build, tvm_debug):
"""Testing QEMU make fail."""
model, zephyr_board = PLATFORMS[platform]
Expand Down

0 comments on commit c33ef38

Please sign in to comment.