From dbbfb86603bfab9a4e922ed8b6413685a4b2fecd Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Thu, 17 Feb 2022 15:03:51 +0100 Subject: [PATCH] tests: drivers: add tlc5971 led strip driver to build_all add to build_all for build coverage in CI. Signed-off-by: Mikkel Jakobsen --- .../build_all/led_strip/CMakeLists.txt | 8 +++ tests/drivers/build_all/led_strip/app.overlay | 55 +++++++++++++++++++ tests/drivers/build_all/led_strip/prj.conf | 7 +++ tests/drivers/build_all/led_strip/src/main.c | 9 +++ .../drivers/build_all/led_strip/testcase.yaml | 6 ++ 5 files changed, 85 insertions(+) create mode 100644 tests/drivers/build_all/led_strip/CMakeLists.txt create mode 100644 tests/drivers/build_all/led_strip/app.overlay create mode 100644 tests/drivers/build_all/led_strip/prj.conf create mode 100644 tests/drivers/build_all/led_strip/src/main.c create mode 100644 tests/drivers/build_all/led_strip/testcase.yaml diff --git a/tests/drivers/build_all/led_strip/CMakeLists.txt b/tests/drivers/build_all/led_strip/CMakeLists.txt new file mode 100644 index 00000000000..518596a02f7 --- /dev/null +++ b/tests/drivers/build_all/led_strip/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/led_strip/app.overlay b/tests/drivers/build_all/led_strip/app.overlay new file mode 100644 index 00000000000..e9e8d126353 --- /dev/null +++ b/tests/drivers/build_all/led_strip/app.overlay @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020, Linaro Ltd. + * Copyright (c) 2022, Esco Medical ApS + * + * SPDX-License-Identifier: Apache-2.0 + * + * Application overlay for testing driver builds + * + * Names in this file should be chosen in a way that won't conflict + * with real-world devicetree nodes, to allow these tests to run on + * (and be extended to test) real hardware. + */ + +#include +#include + +/ { + test { + #address-cells = <1>; + #size-cells = <1>; + + test_gpio: gpio@deadbeef { + compatible = "vnd,gpio"; + gpio-controller; + reg = <0xdeadbeef 0x1000>; + #gpio-cells = <0x2>; + label = "TEST_GPIO_1"; + status = "okay"; + }; + + test_spi: spi@33334444 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "vnd,spi"; + reg = <0x33334444 0x1000>; + label = "TEST_SPI_CTLR"; + status = "okay"; + clock-frequency = ; + + cs-gpios = <&test_gpio 0 0>; + + test_spi_tlc5971: tlc5971@0 { + status = "okay"; + compatible = "ti,tlc59711", "ti,tlc5971"; + label = "TLC5971"; + spi-max-frequency = ; + reg = <0x0>; + chain-length = <8>; // two TLC5971 devices + color-mapping = , + , + ; + }; + }; + }; +}; diff --git a/tests/drivers/build_all/led_strip/prj.conf b/tests/drivers/build_all/led_strip/prj.conf new file mode 100644 index 00000000000..ac3c9da0c81 --- /dev/null +++ b/tests/drivers/build_all/led_strip/prj.conf @@ -0,0 +1,7 @@ +CONFIG_TEST=y +CONFIG_TEST_USERSPACE=y + +CONFIG_GPIO=y +CONFIG_SPI=y +CONFIG_LED_STRIP=y +CONFIG_TLC5971_STRIP=y diff --git a/tests/drivers/build_all/led_strip/src/main.c b/tests/drivers/build_all/led_strip/src/main.c new file mode 100644 index 00000000000..4c24d7f29b7 --- /dev/null +++ b/tests/drivers/build_all/led_strip/src/main.c @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2012-2014 Wind River Systems, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +void main(void) +{ +} diff --git a/tests/drivers/build_all/led_strip/testcase.yaml b/tests/drivers/build_all/led_strip/testcase.yaml new file mode 100644 index 00000000000..65f6bce78a6 --- /dev/null +++ b/tests/drivers/build_all/led_strip/testcase.yaml @@ -0,0 +1,6 @@ +tests: + drivers.led_strip.build: + build_only: true + min_ram: 32 + tags: drivers + depends_on: gpio spi