Skip to content

Commit fee055b

Browse files
committed
samples: drivers: adc: enhance test filtering and config
Make tests and test scenaries depend on the existence of required DT elements. Now that samples are filtered automatically depending on DT, remove platform_allow/exclude from generic test scenarios. Add more integration platforms to cover most ADC IPs/drivers. Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
1 parent 314e57a commit fee055b

File tree

6 files changed

+43
-50
lines changed

6 files changed

+43
-50
lines changed

boards/gd/gd32f350r_eval/gd32f350r_eval.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ toolchain:
1313
supported:
1414
- watchdog
1515
- dma
16+
- adc
1617
vendor: gd

boards/nxp/lpcxpresso55s36/lpcxpresso55s36.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ toolchain:
1414
- zephyr
1515
- gnuarmemb
1616
supported:
17+
- adc
1718
- arduino_gpio
1819
- can
1920
- dac

samples/drivers/adc/adc_dt/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ADC DT sample configuration options
2+
3+
# Copyright The Zephyr Project Contributors
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
source "Kconfig.zephyr"
7+
8+
ZEPHYR_USER := zephyr,user
9+
10+
config SAMPLE_ADC_DT_RUN
11+
bool "Run ADC DT Sample"
12+
default y if $(dt_node_has_prop,/$(ZEPHYR_USER),io-channels)
13+
help
14+
Platform supports ADC DT Sample

samples/drivers/adc/adc_dt/sample.yaml

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,26 @@
11
sample:
22
name: ADC devicetree driver sample
3+
common:
4+
tags:
5+
- adc
6+
depends_on: adc
7+
filter: CONFIG_SAMPLE_ADC_DT_RUN
8+
39
tests:
410
sample.drivers.adc.adc_dt:
5-
tags:
6-
- adc
7-
depends_on: adc
8-
platform_allow:
9-
- nucleo_l073rz
10-
- disco_l475_iot1
11+
integration_platforms:
1112
- cc3220sf_launchxl
12-
- cc3235sf_launchxl
13-
- cy8cproto_063_ble
14-
- stm32l496g_disco
15-
- stm32h735g_disco
16-
- nrf51dk/nrf51822
17-
- nrf52840dk/nrf52840
18-
- nrf54h20dk/nrf54h20/cpuapp
19-
- nrf54l15dk/nrf54l15/cpuapp
20-
- nrf54lm20dk/nrf54lm20a/cpuapp
21-
- ophelia4ev/nrf54l15/cpuapp
22-
- mec172xevb_assy6906
23-
- gd32f350r_eval
24-
- gd32f450i_eval
25-
- gd32vf103v_eval
26-
- gd32f403z_eval
27-
- esp32_devkitc/esp32/procpu
28-
- esp32s2_saola
2913
- esp32c3_devkitm
30-
- gd32l233r_eval
14+
- frdm_mcxa166
15+
- gd32f350r_eval
3116
- lpcxpresso55s36
32-
- mr_canhubk3
33-
- longan_nano
34-
- longan_nano/gd32vf103/lite
35-
- rd_rw612_bga
36-
- frdm_mcxn947/mcxn947/cpu0
3717
- mcx_n9xx_evk/mcxn947/cpu0
38-
- frdm_mcxc242
39-
- ucans32k1sic
40-
- xg24_rb4187c
41-
- xg29_rb4412a
42-
- raytac_an54l15q_db/nrf54l15/cpuapp
43-
- frdm_mcxa166
44-
- frdm_mcxa276
45-
- s32k148_evb
46-
integration_platforms:
47-
- nucleo_l073rz
18+
- mec172xevb_assy6906
4819
- nrf52840dk/nrf52840
20+
- nucleo_l073rz
21+
- rd_rw612_bga
22+
- s32k148_evb
23+
- xg24_rb4187c
4924
harness: console
5025
timeout: 10
5126
harness_config:

samples/drivers/adc/adc_sequence/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Copyright (c) 2024 Centro de Inovacao EDGE.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
config SAMPLE_ADC_SEQ_RUN
5+
bool "Run ADC Sequence Sample"
6+
default y if $(dt_alias_enabled,adc0)
7+
help
8+
Platform supports ADC Sequence Sample
9+
10+
if SAMPLE_ADC_SEQ_RUN
11+
412
config SEQUENCE_SAMPLES
513
int "Number of samples to be made on the sequence for each channel."
614
default 5
@@ -13,4 +21,6 @@ config SEQUENCE_32BITS_REGISTERS
1321
bool "ADC data sequences are on 32bits"
1422
default n
1523

24+
endif # SAMPLE_ADC_SEQ_RUN
25+
1626
source "Kconfig.zephyr"

samples/drivers/adc/adc_sequence/sample.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ common:
44
tags:
55
- adc
66
depends_on: adc
7+
filter: CONFIG_SAMPLE_ADC_SEQ_RUN
78
harness: console
89
timeout: 10
910
harness_config:
@@ -14,21 +15,12 @@ common:
1415
- "- - \\d+ (= \\d+mV)|(\\(value in mV not available\\))"
1516
tests:
1617
sample.drivers.adc.adc_sequence:
17-
platform_allow:
18+
integration_platforms:
1819
- cy8cproto_063_ble
19-
- cy8cproto_062_4343w
20+
- frdm_mcxc242
2021
- nrf52840dk/nrf52840
21-
- nrf54h20dk/nrf54h20/cpuapp
22-
- nrf54l15dk/nrf54l15/cpuapp
23-
- nrf54lm20dk/nrf54lm20a/cpuapp
24-
- ophelia4ev/nrf54l15/cpuapp
25-
- raytac_an54l15q_db/nrf54l15/cpuapp
26-
- ucans32k1sic
2722
- s32k148_evb
28-
- frdm_mcxc242
2923
- stm32f3_disco
30-
integration_platforms:
31-
- nrf52840dk/nrf52840
3224
sample.drivers.adc.adc_sequence.8bit:
3325
platform_allow:
3426
- nrf54h20dk/nrf54h20/cpuapp

0 commit comments

Comments
 (0)