diff --git a/tests/drivers/build_all/mdio/CMakeLists.txt b/tests/drivers/build_all/mdio/CMakeLists.txt new file mode 100644 index 00000000000..518596a02f7 --- /dev/null +++ b/tests/drivers/build_all/mdio/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(build_all) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/build_all/mdio/app.overlay b/tests/drivers/build_all/mdio/app.overlay new file mode 100644 index 00000000000..82392465d23 --- /dev/null +++ b/tests/drivers/build_all/mdio/app.overlay @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Aleksandr Senin + * + * 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>; + status = "okay"; + }; + + test_mdio0: mdio@11112222 { + compatible = "zephyr,mdio-gpio"; + reg = <0x11112222 1>; + mdc-gpios = <&test_gpio 0 0>; + mdio-gpios = <&test_gpio 0 0>; + status = "okay"; + }; + + test_mdio1: mdio@33334444 { + compatible = "zephyr,mdio-gpio"; + reg = <0x33334444 1>; + mdc-gpios = <&test_gpio 0 0>; + mdio-gpios = <&test_gpio 0 0>; + status = "okay"; + }; + }; +}; diff --git a/tests/drivers/build_all/mdio/prj.conf b/tests/drivers/build_all/mdio/prj.conf new file mode 100644 index 00000000000..1e4bd3763fb --- /dev/null +++ b/tests/drivers/build_all/mdio/prj.conf @@ -0,0 +1,5 @@ +CONFIG_TEST=y +CONFIG_TEST_USERSPACE=y +CONFIG_GPIO=y +CONFIG_MDIO=y +CONFIG_MDIO_GPIO=y diff --git a/tests/drivers/build_all/mdio/src/main.c b/tests/drivers/build_all/mdio/src/main.c new file mode 100644 index 00000000000..4c52a4c62a6 --- /dev/null +++ b/tests/drivers/build_all/mdio/src/main.c @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2023 Aleksandr Senin + * + * SPDX-License-Identifier: Apache-2.0 + */ + +int main(void) +{ + return 0; +} diff --git a/tests/drivers/build_all/mdio/testcase.yaml b/tests/drivers/build_all/mdio/testcase.yaml new file mode 100644 index 00000000000..19e16e0f2be --- /dev/null +++ b/tests/drivers/build_all/mdio/testcase.yaml @@ -0,0 +1,8 @@ +common: + build_only: true + tags: + - drivers + - mdio +tests: + drivers.mdio.build: + platform_allow: qemu_cortex_m0