tests: drivers: stepper: build all

This commit introduces preliminary build all test for stepper driver

Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
This commit is contained in:
Jilay Pandya 2024-08-08 15:26:42 +02:00 committed by Carles Cufí
commit 179f990e46
6 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 Carl Zeiss Meditec AG
# 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)

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2023 Carl Zeiss Meditec AG
* 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";
#include "gpio.dtsi"
};
};
};

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2023 Carl Zeiss Meditec AG
* SPDX-License-Identifier: Apache-2.0
*/
test_uln2003_motor_cluster: uln2003_motor_cluster {
compatible = "gpio-steppers";
status = "okay";
motor_1: motor_1 {
micro-step-res = <1>;
gpios = <&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>;
};
motor_2: motor_2 {
micro-step-res = <2>;
gpios = <&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>;
};
};

View file

@ -0,0 +1,7 @@
CONFIG_TEST=y
CONFIG_TEST_USERSPACE=y
CONFIG_LOG=y
CONFIG_STEPPER_LOG_LEVEL_DBG=y
CONFIG_POLL=y
CONFIG_GPIO=y
CONFIG_STEPPER=y

View file

@ -0,0 +1,9 @@
/*
* Copyright (c) 2023 Carl Zeiss Meditec AG
* SPDX-License-Identifier: Apache-2.0
*/
int main(void)
{
return 0;
}

View file

@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 Carl Zeiss Meditec AG
# SPDX-License-Identifier: Apache-2.0
tests:
drivers.stepper.build:
tags:
- drivers
- stepper
build_only: true
platform_allow:
- native_posix
- native_sim