From a774cbc61ac6f0ba9e7149969d9362b23c33638a Mon Sep 17 00:00:00 2001 From: Ricardo Rivera-Matos Date: Wed, 10 Jan 2024 09:41:58 -0600 Subject: [PATCH] tests: build_all: Adds Haptics build test Adds Haptics build test Signed-off-by: Ricardo Rivera-Matos --- .../drivers/build_all/haptics/CMakeLists.txt | 8 +++++++ tests/drivers/build_all/haptics/app.overlay | 24 +++++++++++++++++++ tests/drivers/build_all/haptics/i2c.dtsi | 14 +++++++++++ tests/drivers/build_all/haptics/prj.conf | 1 + tests/drivers/build_all/haptics/src/main.c | 9 +++++++ tests/drivers/build_all/haptics/testcase.yaml | 11 +++++++++ 6 files changed, 67 insertions(+) create mode 100644 tests/drivers/build_all/haptics/CMakeLists.txt create mode 100644 tests/drivers/build_all/haptics/app.overlay create mode 100644 tests/drivers/build_all/haptics/i2c.dtsi create mode 100644 tests/drivers/build_all/haptics/prj.conf create mode 100644 tests/drivers/build_all/haptics/src/main.c create mode 100644 tests/drivers/build_all/haptics/testcase.yaml diff --git a/tests/drivers/build_all/haptics/CMakeLists.txt b/tests/drivers/build_all/haptics/CMakeLists.txt new file mode 100644 index 000000000000..9bc0a6e2b1c5 --- /dev/null +++ b/tests/drivers/build_all/haptics/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Cirrus Logic, Inc. +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(build_all) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/drivers/build_all/haptics/app.overlay b/tests/drivers/build_all/haptics/app.overlay new file mode 100644 index 000000000000..a80b0cf28057 --- /dev/null +++ b/tests/drivers/build_all/haptics/app.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 Cirrus Logic, Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + + #include + +/ { + test { + #address-cells = <1>; + #size-cells = <1>; + + test_i2c: i2c@11112222 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "vnd,i2c"; + reg = <0x11112222 0x1000>; + status = "okay"; + clock-frequency = ; + + #include "i2c.dtsi" + }; + }; +}; diff --git a/tests/drivers/build_all/haptics/i2c.dtsi b/tests/drivers/build_all/haptics/i2c.dtsi new file mode 100644 index 000000000000..2038347e11ad --- /dev/null +++ b/tests/drivers/build_all/haptics/i2c.dtsi @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Cirrus Logic, Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/**************************************** + * PLEASE KEEP REG ADDRESSES SEQUENTIAL * + ***************************************/ + +drv2605@0 { + compatible = "ti,drv2605"; + reg = <0x0>; + status = "okay"; +}; diff --git a/tests/drivers/build_all/haptics/prj.conf b/tests/drivers/build_all/haptics/prj.conf new file mode 100644 index 000000000000..db62174a0dd1 --- /dev/null +++ b/tests/drivers/build_all/haptics/prj.conf @@ -0,0 +1 @@ +CONFIG_HAPTICS=y diff --git a/tests/drivers/build_all/haptics/src/main.c b/tests/drivers/build_all/haptics/src/main.c new file mode 100644 index 000000000000..c619685d4500 --- /dev/null +++ b/tests/drivers/build_all/haptics/src/main.c @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Cirrus Logic, Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +int main(void) +{ + return 0; +} diff --git a/tests/drivers/build_all/haptics/testcase.yaml b/tests/drivers/build_all/haptics/testcase.yaml new file mode 100644 index 000000000000..97d0dd67b55f --- /dev/null +++ b/tests/drivers/build_all/haptics/testcase.yaml @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Cirrus Logic, Inc. +# SPDX-License-Identifier: Apache-2.0 + +tests: + drivers.haptics.build: + tags: + - drivers + - haptics + build_only: true + platform_allow: + - native_sim