samples: sensor: Use dedicated overlay for fake sensor in sensor_shell

Using an app.overlay file is inherently preventing the use of board
overlays. Switch to a dedicated overlay file so that e.g.
the vmu_rt1170/mimxrt1176/cm7 board target can pass this test where
before it would have failed due to its board-specific overlay "winning"
over the app.overlay file.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2025-02-17 08:23:42 +01:00 committed by Benjamin Cabé
parent a2fffdc038
commit 86eea62e0b
4 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,8 @@
config SAMPLES_SENSOR_SHELL_FAKE_SENSOR
bool "Enable fake sensor"
default y
depends on DT_HAS_VND_FAKE_SENSOR_ENABLED
help
On boards that do not have a sensor, enabling this will build a fake
sensor that can be interacted with via the sensor shell.

View File

@ -19,13 +19,14 @@ enabled, for example:
:board: reel_board
:goals: build flash
For boards that do not have a sensor, a simple fake sensor driver is provided, for example:
For boards that do not have a sensor, a simple fake sensor driver is provided and can enabled by
adding the following overlay:
.. zephyr-app-commands::
:zephyr-app: samples/sensor/sensor_shell
:board: qemu_riscv64
:goals: run
:gen-args: -DCONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y
:gen-args: -DEXTRA_DTC_OVERLAY_FILE=fake_sensor.overlay
Shell Module Command Help
=========================

View File

@ -22,6 +22,6 @@ tests:
timeout: 180
extra_configs:
- arch:posix:CONFIG_NATIVE_UART_0_ON_STDINOUT=y
- CONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y
extra_args: DTC_OVERLAY_FILE=fake_sensor.overlay
integration_platforms:
- native_sim