From 407e9a4c74d610f57a1e1b54d3a9f5adf724495d Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Wed, 22 Nov 2023 23:13:18 +0000 Subject: [PATCH] test: add a gnss build_all test Add a generic test for GNSS devices. Signed-off-by: Fabio Baltieri --- MAINTAINERS.yml | 1 + tests/drivers/build_all/gnss/CMakeLists.txt | 8 ++++++++ tests/drivers/build_all/gnss/app.overlay | 22 +++++++++++++++++++++ tests/drivers/build_all/gnss/prj.conf | 3 +++ tests/drivers/build_all/gnss/src/main.c | 10 ++++++++++ tests/drivers/build_all/gnss/testcase.yaml | 8 ++++++++ 6 files changed, 52 insertions(+) create mode 100644 tests/drivers/build_all/gnss/CMakeLists.txt create mode 100644 tests/drivers/build_all/gnss/app.overlay create mode 100644 tests/drivers/build_all/gnss/prj.conf create mode 100644 tests/drivers/build_all/gnss/src/main.c create mode 100644 tests/drivers/build_all/gnss/testcase.yaml diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index f396255606..1f05985450 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1103,6 +1103,7 @@ Release Notes: - doc/hardware/peripherals/gnss.rst - drivers/gnss/ - include/zephyr/drivers/gnss.h + - tests/drivers/build_all/gnss/ - tests/drivers/gnss/ labels: - "area: GNSS" diff --git a/tests/drivers/build_all/gnss/CMakeLists.txt b/tests/drivers/build_all/gnss/CMakeLists.txt new file mode 100644 index 0000000000..518596a02f --- /dev/null +++ b/tests/drivers/build_all/gnss/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(build_all) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/build_all/gnss/app.overlay b/tests/drivers/build_all/gnss/app.overlay new file mode 100644 index 0000000000..1d43fa6152 --- /dev/null +++ b/tests/drivers/build_all/gnss/app.overlay @@ -0,0 +1,22 @@ +/* + * Copyright 2023 Google LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + test { + #address-cells = <1>; + #size-cells = <1>; + + test_uart: uart@0 { + compatible = "vnd,serial"; + reg = <0x0 0x1000>; + status = "okay"; + + gnss: gnss-nmea-generic { + compatible = "gnss-nmea-generic"; + }; + }; + }; +}; diff --git a/tests/drivers/build_all/gnss/prj.conf b/tests/drivers/build_all/gnss/prj.conf new file mode 100644 index 0000000000..945eb0df71 --- /dev/null +++ b/tests/drivers/build_all/gnss/prj.conf @@ -0,0 +1,3 @@ +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_GNSS=y diff --git a/tests/drivers/build_all/gnss/src/main.c b/tests/drivers/build_all/gnss/src/main.c new file mode 100644 index 0000000000..ccbdca6d36 --- /dev/null +++ b/tests/drivers/build_all/gnss/src/main.c @@ -0,0 +1,10 @@ +/* + * Copyright 2023 Google LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +int main(void) +{ + return 0; +} diff --git a/tests/drivers/build_all/gnss/testcase.yaml b/tests/drivers/build_all/gnss/testcase.yaml new file mode 100644 index 0000000000..faaec12c74 --- /dev/null +++ b/tests/drivers/build_all/gnss/testcase.yaml @@ -0,0 +1,8 @@ +common: + tags: + - drivers + - gnss + build_only: true + platform_allow: native_sim +tests: + drivers.gnss.default: {}