Commit 25fe4bf9 authored by Stephanos Ioannidis's avatar Stephanos Ioannidis Committed by Kumar Gala
Browse files

tests: drivers: Add console driver test



This commit adds the initial implementation of the console driver test.

The purpose of this test is to verify the output functionality of the
various types of console drivers (UART and semihost console types are
supported for now).

Signed-off-by: default avatarStephanos Ioannidis <root@stephanos.io>
parent 2c00c8e5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

project(console)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
+2 −0
Original line number Diff line number Diff line
CONFIG_TEST=y
CONFIG_CONSOLE=y
+6 −0
Original line number Diff line number Diff line
CONFIG_TEST=y
CONFIG_CONSOLE=y
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USB_UART_CONSOLE=n
CONFIG_SEMIHOST_CONSOLE=y
+13 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020 Stephanos Ioannidis <root@stephanos.io>
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <sys/printk.h>

void main(void)
{
	printk("Hello World from Console\n");
}
+17 −0
Original line number Diff line number Diff line
common:
    tags: drivers console
    harness: console
    harness_config:
      type: one_line
      regex:
        - "Hello World from Console"

tests:
  drivers.console.uart:
    tags: drivers console
    filter: CONFIG_UART_CONSOLE
  drivers.console.semihost:
    tags: drivers console
    arch_whitelist: arm
    filter: CONFIG_CPU_CORTEX_M
    extra_args: CONF_FILE=prj_semihost.conf