tests: drivers: build_all: split gpio test out
Move gpio tests to their own directory. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
91a2d53e9c
commit
a4a685b9f8
6 changed files with 134 additions and 6 deletions
8
tests/drivers/build_all/gpio/CMakeLists.txt
Normal file
8
tests/drivers/build_all/gpio/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.13.1)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(build_all)
|
||||
|
||||
FILE(GLOB app_sources src/*.c)
|
||||
target_sources(app PRIVATE ${app_sources})
|
89
tests/drivers/build_all/gpio/app.overlay
Normal file
89
tests/drivers/build_all/gpio/app.overlay
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Linaro Ltd.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/ {
|
||||
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_i2c: i2c@11112222 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "vnd,i2c";
|
||||
reg = <0x11112222 0x1000>;
|
||||
label = "TEST_I2C_CTLR";
|
||||
status = "okay";
|
||||
clock-frequency = <100000>;
|
||||
|
||||
test_i2c_sx1509b: sx1509b@0 {
|
||||
compatible = "semtech,sx1509b";
|
||||
label = "SX1509B";
|
||||
reg = <0x0>;
|
||||
#gpio-cells = <2>;
|
||||
ngpios = <16>;
|
||||
gpio-controller;
|
||||
};
|
||||
|
||||
test_i2c_pcal6408a: pcal6408a@1 {
|
||||
compatible = "nxp,pcal6408a";
|
||||
label = "PCAL6408A";
|
||||
reg = <0x1>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
ngpios = <8>;
|
||||
int-gpios = <&test_gpio 0 0>;
|
||||
reset-gpios = <&test_gpio 0 0>;
|
||||
};
|
||||
|
||||
test_i2c_pca95xx: pca95xx@2 {
|
||||
compatible = "nxp,pca95xx";
|
||||
label = "PCA95XX";
|
||||
reg = <0x2>;
|
||||
/* has-pud; */
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
|
||||
test_spi: spi@33334444 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "vnd,spi";
|
||||
reg = <0x33334444 0x1000>;
|
||||
label = "TEST_SPI_CTLR";
|
||||
status = "okay";
|
||||
clock-frequency = <2000000>;
|
||||
|
||||
/* one entry for every devices at spi.dtsi */
|
||||
cs-gpios = <&test_gpio 0 0>;
|
||||
|
||||
test_spi_mcp23s17: mcp23s17@0 {
|
||||
compatible = "microchip,mcp23s17";
|
||||
label = "GPIO_E0";
|
||||
spi-max-frequency = <0>;
|
||||
reg = <0x0>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
ngpios = <16>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
29
tests/drivers/build_all/gpio/src/main.c
Normal file
29
tests/drivers/build_all/gpio/src/main.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2014 Wind River Systems, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <sys/printk.h>
|
||||
#include <device.h>
|
||||
|
||||
|
||||
/*
|
||||
* @file
|
||||
* @brief Hello World demo
|
||||
*/
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
printk("Hello World!\n");
|
||||
}
|
||||
|
||||
#if DT_NODE_EXISTS(DT_INST(0, vnd_gpio))
|
||||
/* Fake GPIO device, needed for building drivers that use DEVICE_DT_GET()
|
||||
* to access GPIO controllers.
|
||||
*/
|
||||
DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
|
||||
#endif
|
8
tests/drivers/build_all/gpio/testcase.yaml
Normal file
8
tests/drivers/build_all/gpio/testcase.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
common:
|
||||
build_only: true
|
||||
tags: drivers
|
||||
tests:
|
||||
drivers.gpio.build:
|
||||
min_ram: 32
|
||||
platform_exclude: serpente
|
||||
depends_on: gpio spi i2c
|
|
@ -1,12 +1,6 @@
|
|||
common:
|
||||
depends_on: gpio spi i2c
|
||||
tests:
|
||||
drivers.gpio.build:
|
||||
build_only: true
|
||||
extra_args: CONF_FILE=gpio.conf
|
||||
min_ram: 32
|
||||
platform_exclude: serpente
|
||||
depends_on: gpio spi
|
||||
drivers.led.build:
|
||||
build_only: true
|
||||
extra_args: CONF_FILE=led.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue