Skip to content

Commit de7a7c2

Browse files
committed
tests: drivers: build_all: smbus: add build-all suite for smbus drivers
To ensure that code compiles error (and warning) free, add a build-all testsuite for smbus drivers. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
1 parent 84995c8 commit de7a7c2

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(build_all)
6+
7+
FILE(GLOB app_sources src/*.c)
8+
target_sources(app PRIVATE ${app_sources})
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
i2c0: i2c@88888888 {
8+
compatible = "zephyr,i2c-emul";
9+
#address-cells = <1>;
10+
#size-cells = <0>;
11+
reg = <0x88888888 0x10000>;
12+
status = "okay";
13+
};
14+
15+
smbus0: smbus@88898888 {
16+
compatible = "st,stm32-smbus";
17+
#address-cells = <1>;
18+
#size-cells = <0>;
19+
reg = <0x88898888 0x10000>;
20+
i2c = <&i2c0>;
21+
status = "okay";
22+
};
23+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_TEST=y
2+
CONFIG_TEST_USERSPACE=y
3+
CONFIG_I2C=y
4+
CONFIG_I2C_TARGET=y
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
int main(void)
7+
{
8+
return 0;
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
common:
2+
build_only: true
3+
tags:
4+
- drivers
5+
- i2c
6+
- smbus
7+
tests:
8+
drivers.smbus.build:
9+
# will cover drivers without in-tree boards
10+
platform_allow: qemu_cortex_m3
11+
extra_args: "CONFIG_SMBUS=y"

0 commit comments

Comments
 (0)