Skip to content

Commit

Permalink
tests: drivers: build_all: Add a build_all test for eeprom
Browse files Browse the repository at this point in the history
The test targets the following devices at this time.

- microchip,mcp7940n

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
  • Loading branch information
soburi committed Sep 27, 2024
1 parent a486a7b commit 8e98c28
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/drivers/build_all/bbram/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(build_all)

target_sources(app PRIVATE src/main.c)
24 changes: 24 additions & 0 deletions tests/drivers/build_all/bbram/app.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/i2c/i2c.h>

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

test_i2c: i2c@11112222 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "vnd,i2c";
reg = <0x11112222 0x1000>;
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;

#include "i2c.dtsi"
};
};
};
14 changes: 14 additions & 0 deletions tests/drivers/build_all/bbram/i2c.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi
* SPDX-License-Identifier: Apache-2.0
*/

/****************************************
* PLEASE KEEP REG ADDRESSES SEQUENTIAL *
***************************************/

mcp7940n@0 {
compatible = "microchip,mcp7940n";
reg = <0x0>;
status = "okay";
};
1 change: 1 addition & 0 deletions tests/drivers/build_all/bbram/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_BBRAM=y
9 changes: 9 additions & 0 deletions tests/drivers/build_all/bbram/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi
* SPDX-License-Identifier: Apache-2.0
*/

int main(void)
{
return 0;
}
21 changes: 21 additions & 0 deletions tests/drivers/build_all/bbram/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2024 TOKITA hiroshi
# SPDX-License-Identifier: Apache-2.0

tests:
drivers.bbram.build:
tags:
- drivers
- bbram
build_only: true
platform_allow:
- native_sim

drivers.bbram.emul.build:
tags:
- drivers
- bbram
build_only: true
platform_allow:
- native_sim
extra_configs:
- CONFIG_EMUL=y

0 comments on commit 8e98c28

Please sign in to comment.