Skip to content

Commit 2215b12

Browse files
committed
tests: drivers: adc: enhance test scenarios filtering
Make ADC tests' test scenarios depend on the existence of required DT elements. Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
1 parent 1b0dd90 commit 2215b12

File tree

6 files changed

+34
-25
lines changed

6 files changed

+34
-25
lines changed

boards/renesas/ek_ra8m1/ek_ra8m1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ supported:
1616
- i2s
1717
- i3c
1818
- crc
19+
- adc
1920
vendor: renesas

tests/drivers/adc/adc_accuracy_test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
cmake_minimum_required(VERSION 3.20.0)
44

55
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6-
project(dac_accuracy)
6+
project(adc_accuracy)
77

88
target_sources(app PRIVATE src/main.c)
99
target_sources_ifdef(CONFIG_REFERENCE_VOLTAGE_TEST app PRIVATE src/ref_volt.c)

tests/drivers/adc/adc_accuracy_test/Kconfig

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ source "Kconfig.zephyr"
1111
ZEPHYR_USER := zephyr,user
1212

1313
config DAC_SOURCE_TEST
14-
bool
14+
bool "Test using a DAC source"
1515
select DAC
16-
default y if $(dt_node_has_prop,/$(ZEPHYR_USER),dac)
16+
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),dac)
17+
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),dac-channel-id)
18+
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),dac-resolution)
1719

1820
config REFERENCE_VOLTAGE_TEST
19-
bool
20-
default y if $(dt_node_has_prop,/$(ZEPHYR_USER),reference-mv)
21+
bool "Test using a ref voltage source"
22+
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),reference-mv)
23+
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),expected-accuracy)
2124

2225
config NUMBER_OF_PASSES
2326
int "Number of passes"

tests/drivers/adc/adc_accuracy_test/testcase.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,25 @@ common:
44
- drivers
55
depends_on:
66
- adc
7+
filter: dt_node_has_prop("/zephyr,user","io-channels")
8+
79
tests:
810
drivers.adc.accuracy.dac_source:
911
depends_on:
1012
- dac
13+
extra_configs:
14+
- CONFIG_DAC_SOURCE_TEST=y
15+
# Test scenario is filtered if Kconfig dependencies are not satisfied
16+
filter: CONFIG_DAC_SOURCE_TEST
1117
harness_config:
1218
fixture: dac_adc_loopback
1319
platform_allow:
1420
- frdm_k64f
1521
drivers.adc.accuracy.ref_volt:
22+
extra_configs:
23+
- CONFIG_REFERENCE_VOLTAGE_TEST=y
24+
# Test scenario is filtered if Kconfig dependencies are not satisfied
25+
filter: CONFIG_REFERENCE_VOLTAGE_TEST
1626
harness_config:
1727
fixture: adc_ref_volt
1828
platform_allow:

tests/drivers/adc/adc_api/testcase.yaml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ common:
33
- adc
44
- drivers
55
- userspace
6+
depends_on: adc
7+
filter: dt_node_has_prop("/zephyr,user","io-channels")
8+
min_flash: 40
9+
610
tests:
711
drivers.adc:
8-
depends_on: adc
9-
min_flash: 40
1012
platform_exclude:
1113
- nucleo_u031r8
1214
- panb611evb/nrf54l15/cpuapp
@@ -21,28 +23,19 @@ tests:
2123
- rpi_pico/rp2040/w/mcuboot
2224
- rpi_pico2/rp2350a/m33/mcuboot
2325
- rpi_pico2/rp2350a/m33/w/mcuboot
24-
drivers.adc.b_u585i_iot02a_adc4:
25-
extra_args:
26-
- DTC_OVERLAY_FILE="boards/b_u585i_iot02a_adc4.overlay"
27-
platform_allow:
28-
- b_u585i_iot02a
29-
drivers.adc.nucleo_f103rb_dma:
3026
extra_args:
31-
- DTC_OVERLAY_FILE="boards/nucleo_f103rb_dma.overlay"
32-
- EXTRA_CONF_FILE="overlay-dma-stm32.conf"
33-
platform_allow:
34-
- nucleo_f103rb
27+
- platform:b_u585i_iot02a/stm32u585xx:DTC_OVERLAY_FILE="boards/b_u585i_iot02a_adc4.overlay"
28+
integration_platforms:
29+
- native_sim
30+
- native_sim/native/64
3531
drivers.adc.dma_st_stm32:
36-
extra_args:
37-
- EXTRA_CONF_FILE="overlay-dma-stm32.conf"
3832
depends_on:
39-
- adc
4033
- dma
41-
min_flash: 40
4234
platform_allow:
4335
- b_u585i_iot02a
4436
- disco_l475_iot1
4537
- nucleo_f091rc
38+
- nucleo_f103rb
4639
- nucleo_f207zg
4740
- nucleo_f401re
4841
- nucleo_f429zi
@@ -65,14 +58,16 @@ tests:
6558
- stm32f3_disco
6659
- stm32h573i_dk
6760
- stm32u083c_dk
61+
extra_args:
62+
- EXTRA_CONF_FILE=overlay-dma-stm32.conf
63+
- platform:nucleo_f103rb/stm32f103xb:DTC_OVERLAY_FILE="boards/nucleo_f103rb_dma.overlay"
6864
integration_platforms:
6965
- disco_l475_iot1
7066
- nucleo_l476rg
7167
drivers.adc.dma_nxp_kinetis:
7268
extra_args:
7369
- EXTRA_CONF_FILE="overlay-dma-kinetis.conf"
7470
depends_on:
75-
- adc
7671
- dma
7772
min_flash: 40
7873
platform_allow:
@@ -82,10 +77,9 @@ tests:
8277
- frdm_k82f
8378
drivers.adc.dma_espressif:
8479
extra_args:
85-
- DTC_OVERLAY_FILE="boards/esp32s3_devkitc_procpu.overlay"
80+
- platform:esp32s3_devkitc/esp32s3/procpu:DTC_OVERLAY_FILE="boards/esp32s3_devkitc_procpu.overlay"
8681
- EXTRA_CONF_FILE="overlay-dma-esp32.conf"
8782
depends_on:
88-
- adc
8983
- dma
9084
platform_allow:
9185
- esp32s3_devkitc/esp32s3/procpu

tests/drivers/adc/adc_error_cases/testcase.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ common:
22
tags:
33
- adc
44
- drivers
5+
depends_on: adc
6+
filter: dt_alias_exists("adc")
57

68
tests:
79
drivers.adc_error_cases:
8-
depends_on: adc
910
platform_allow:
1011
- nrf52840dk/nrf52840
1112
- nrf54l15dk/nrf54l15/cpuapp

0 commit comments

Comments
 (0)