From 75cb6e64986332e48729f33492cba30da42ed8d7 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 21 Oct 2021 12:13:55 -0400 Subject: [PATCH] tests: uefi: move uefi test out of hello world Do not misuse the hello world sample for testing of features, keep it simple. Create a new test for booting with uefi instead. Signed-off-by: Anas Nashif --- samples/hello_world/sample.yaml | 3 --- tests/boot/uefi/CMakeLists.txt | 8 ++++++++ .../prj_uefi.conf => tests/boot/uefi/prj.conf | 0 tests/boot/uefi/src/main.c | 13 +++++++++++++ tests/boot/uefi/testcase.yaml | 10 ++++++++++ 5 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 tests/boot/uefi/CMakeLists.txt rename samples/hello_world/prj_uefi.conf => tests/boot/uefi/prj.conf (100%) create mode 100644 tests/boot/uefi/src/main.c create mode 100644 tests/boot/uefi/testcase.yaml diff --git a/samples/hello_world/sample.yaml b/samples/hello_world/sample.yaml index 2bdf00b9330..bacc394eb45 100644 --- a/samples/hello_world/sample.yaml +++ b/samples/hello_world/sample.yaml @@ -14,6 +14,3 @@ common: tests: sample.basic.helloworld: tags: introduction - sample.basic.helloworld.uefi: - platform_allow: qemu_x86_64 - extra_args: CONF_FILE=prj_uefi.conf diff --git a/tests/boot/uefi/CMakeLists.txt b/tests/boot/uefi/CMakeLists.txt new file mode 100644 index 00000000000..d3fe1373817 --- /dev/null +++ b/tests/boot/uefi/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(boot_uefi) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/hello_world/prj_uefi.conf b/tests/boot/uefi/prj.conf similarity index 100% rename from samples/hello_world/prj_uefi.conf rename to tests/boot/uefi/prj.conf diff --git a/tests/boot/uefi/src/main.c b/tests/boot/uefi/src/main.c new file mode 100644 index 00000000000..6c5c8a27dc6 --- /dev/null +++ b/tests/boot/uefi/src/main.c @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2012-2014 Wind River Systems, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +void main(void) +{ + printk("Hello World! %s\n", CONFIG_BOARD); +} diff --git a/tests/boot/uefi/testcase.yaml b/tests/boot/uefi/testcase.yaml new file mode 100644 index 00000000000..208a5418873 --- /dev/null +++ b/tests/boot/uefi/testcase.yaml @@ -0,0 +1,10 @@ +common: + platform_allow: qemu_x86_64 + harness: console + harness_config: + type: one_line + regex: + - "Hello World! (.*)" +tests: + boot.uefi: + tags: uefi