Skip to content

Commit

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

- zephyr,sdmmc-disk
- zephyr,mmc-disk

Signed-off-by: TOKITA Hiroshi <[email protected]>
  • Loading branch information
soburi committed Sep 28, 2024
1 parent 2f47de6 commit 4764e18
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/drivers/build_all/disk/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)
37 changes: 37 additions & 0 deletions tests/drivers/build_all/disk/app.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi
* SPDX-License-Identifier: Apache-2.0
*/

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

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

test_spi: spi@33334444 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "vnd,spi";
reg = <0x33334444 0x1000>;
status = "okay";
clock-frequency = <2000000>;

/* one entry for every devices at spi.dtsi */
cs-gpios = <&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>;

#include "spi.dtsi"
};
};
};
2 changes: 2 additions & 0 deletions tests/drivers/build_all/disk/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_DISK_ACCESS=y
CONFIG_GPIO=y
21 changes: 21 additions & 0 deletions tests/drivers/build_all/disk/spi.dtsi
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
*/

sdhc@0 {
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
status = "okay";
spi-max-frequency = <24000000>;

sdmmc {
compatible = "zephyr,sdmmc-disk";
status = "okay";
};

mmc {
compatible = "zephyr,mmc-disk";
status = "okay";
};
};
9 changes: 9 additions & 0 deletions tests/drivers/build_all/disk/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;
}
12 changes: 12 additions & 0 deletions tests/drivers/build_all/disk/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024 TOKITA hiroshi
# SPDX-License-Identifier: Apache-2.0

tests:
drivers.disk.build:
tags:
- drivers
- disk
build_only: true
platform_allow:
- native_sim
- native_sim/native/64

0 comments on commit 4764e18

Please sign in to comment.