Skip to content

Commit

Permalink
tests: add an input build_all test
Browse files Browse the repository at this point in the history
Add an input build_all test with a bunch of input driver, move the
ft5336 one out of sensors as well.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
  • Loading branch information
fabiobaltieri authored and nashif committed Jun 22, 2023
1 parent c214ec3 commit 80a986f
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 6 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,7 @@ Input:
- include/zephyr/input/
- samples/subsys/input/
- subsys/input/
- tests/drivers/build_all/input/
- tests/subsys/input/
description: >-
Input subsystem and drivers
Expand Down
8 changes: 8 additions & 0 deletions tests/drivers/build_all/input/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
62 changes: 62 additions & 0 deletions tests/drivers/build_all/input/app.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2023 Google LLC
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
test {
#address-cells = <1>;
#size-cells = <1>;

test_gpio: gpio@0 {
compatible = "vnd,gpio";
gpio-controller;
reg = <00 0x1000>;
#gpio-cells = <0x2>;
status = "okay";
};

gpio-keys {
compatible = "zephyr,gpio-keys";
debounce-interval-ms = <30>;
button_0 {
gpios = <&test_gpio 0 0>;
zephyr,code = <0>;
};
};

qdec-gpio {
compatible = "gpio-qdec";
gpios = <&test_gpio 0 0>, <&test_gpio 1 0>;
steps-per-period = <4>;
zephyr,axis = <0>;
sample-time-us = <2000>;
idle-timeout-ms = <200>;
};

longpress: longpress {
input = <&longpress>;
compatible = "zephyr,input-longpress";
input-codes = <0>;
short-codes = <0>;
long-codes = <0>;
long-delay-ms = <100>;
};

i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "vnd,i2c";
reg = <0x1 0x1000>;
status = "okay";
clock-frequency = <100000>;

ft5336@0 {
compatible = "focaltech,ft5336";
reg = <0x0>;
int-gpios = <&test_gpio 0 0>;
};
};
};
};
2 changes: 2 additions & 0 deletions tests/drivers/build_all/input/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_GPIO=y
CONFIG_INPUT=y
10 changes: 10 additions & 0 deletions tests/drivers/build_all/input/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright 2023 Google LLC
*
* SPDX-License-Identifier: Apache-2.0
*/

int main(void)
{
return 0;
}
7 changes: 7 additions & 0 deletions tests/drivers/build_all/input/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tests:
drivers.input.build:
tags:
- drivers
- input
build_only: true
platform_allow: native_posix
6 changes: 0 additions & 6 deletions tests/drivers/build_all/sensor/i2c.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ test_i2c_bmm150: bmm150@d {
reg = <0xd>;
};

test_i2c_ft5336: ft5336@e {
compatible = "focaltech,ft5336";
reg = <0xe>;
int-gpios = <&test_gpio 0 0>;
};

test_i2c_ht16k33: ht16k33@f {
compatible = "holtek,ht16k33";
reg = <0xf>;
Expand Down

0 comments on commit 80a986f

Please sign in to comment.