Skip to content

Commit 13daf24

Browse files
cfriedtjhedberg
authored andcommitted
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 e6fcd9e commit 13daf24

File tree

6 files changed

+44
-0
lines changed

6 files changed

+44
-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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_I2C=y
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
&i2c1 {
7+
status = "okay";
8+
};
9+
10+
&smbus1 {
11+
i2c = <&i2c1>;
12+
status = "okay";
13+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_TEST=y
2+
CONFIG_TEST_USERSPACE=y
3+
CONFIG_SMBUS=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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
common:
2+
build_only: true
3+
tags:
4+
- drivers
5+
- i2c
6+
- smbus
7+
tests:
8+
drivers.smbus.build.stm32:
9+
platform_allow:
10+
- nucleo_g071rb

0 commit comments

Comments
 (0)