Skip to content

Commit 4cc91fd

Browse files
galaknashif
authored andcommitted
sample/tests: replace DT_ define filters with dt_ functions
convert sample and test yaml filters that utilize a DT_ define to instead use a dt_ function. The intent is to remove the Kconfig generated DT defines and just make directy queries into the device tree. Signed-off-by: Kumar Gala <[email protected]>
1 parent 7733b94 commit 4cc91fd

File tree

17 files changed

+27
-19
lines changed

17 files changed

+27
-19
lines changed

samples/basic/blink_led/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sample:
33
tests:
44
sample.blink_led:
55
# FIXME: We should remove those and just rely on depends_on
6-
filter: DT_ALIAS_PWM_LED0_PWMS_CONTROLLER
6+
filter: dt_alias_exists("pwm-led0")
77
tags: drivers pwm
88
depends_on: pwm
99
harness: led

samples/basic/blinky/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ sample:
33
tests:
44
sample.blinky:
55
tags: LED gpio
6-
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER
6+
filter: dt_compat_enabled_with_alias("gpio-leds", "led0")
77
depends_on: gpio
88
harness: led

samples/basic/button/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ sample:
33
tests:
44
sample.button:
55
tags: button gpio
6-
filter: DT_GPIO_KEYS_SW0_GPIOS_CONTROLLER
6+
filter: dt_compat_enabled_with_alias("gpio-keys", "sw0")
77
depends_on: gpio
88
harness: button

samples/basic/disco/sample.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ sample:
22
name: Disco Lights
33
tests:
44
sample.disco:
5-
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
5+
filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and
6+
dt_compat_enabled_with_alias("gpio-leds", "led1")
67
tags: LED gpio
78
depends_on: gpio
89
harness: led

samples/basic/fade_led/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ tests:
55
tags: drivers pwm
66
depends_on: pwm
77
harness: led
8-
filter: DT_ALIAS_PWM_LED0_PWMS_CONTROLLER
8+
filter: dt_alias_exists("pwm-led0")

samples/basic/rgb_led/sample.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ sample:
22
name: RGB LED
33
tests:
44
sample.rgb_led:
5-
filter: DT_ALIAS_RED_PWM_LED_PWMS_CONTROLLER and
6-
DT_ALIAS_GREEN_PWM_LED_PWMS_CONTROLLER and
7-
DT_ALIAS_BLUE_PWM_LED_PWMS_CONTROLLER
5+
filter: dt_alias_exists("red-pwm-led") and
6+
dt_alias_exists("green-pwm-led") and
7+
dt_alias_exists("blue-pwm-led")
88
tags: drivers pwm
99
depends_on: pwm
1010
harness: led

samples/basic/servo_motor/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ tests:
55
tags: drivers pwm
66
depends_on: pwm
77
harness: motor
8-
filter: DT_ALIAS_PWM_0_LABEL
8+
filter: dt_alias_exists("pwm-0")

samples/basic/threads/sample.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ sample:
55
tests:
66
sample.threads:
77
tags: kernel threads gpio
8-
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
8+
filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and
9+
dt_compat_enabled_with_alias("gpio-leds", "led1")
910
depends_on: gpio
1011
harness: console
1112
harness_config:

samples/drivers/gpio/sample.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ sample:
33
tests:
44
sample.driver.gpio:
55
tags: drivers
6-
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_KEYS_SW0_GPIOS_CONTROLLER
6+
filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and
7+
dt_compat_enabled_with_alias("gpio-keys", "sw0")
78
harness: console
89
harness_config:
910
type: one_line

samples/drivers/i2c_fujitsu_fram/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tests:
44
sample.driver.i2c_fujitsu_fram:
55
tags: drivers
66
depends_on: i2c
7-
filter: DT_ALIAS_I2C_0_LABEL
7+
filter: dt_alias_exists("i2c-0")
88
harness: console
99
harness_config:
1010
type: one_line

samples/drivers/led_apa102c_bitbang/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ sample:
33
tests:
44
sample.driver.led_apa102c_bitbang:
55
tags: LED
6-
filter: DT_ALIAS_GPIO_0_LABEL
6+
filter: dt_alias_exists("gpio-0")
77
depends_on: gpio

samples/drivers/spi_flash/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sample:
33
tests:
44
sample.driver.spi_flash:
55
tags: spi flash
6-
filter: DT_INST_0_JEDEC_SPI_NOR_LABEL
6+
filter: dt_compat_enabled("jedec,spi-nor")
77
harness: console
88
harness_config:
99
type: multi_line

samples/subsys/usb/hid-mouse/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ tests:
44
sample.usb.hid-mouse:
55
depends_on: usb_device gpio
66
harness: button
7-
filter: DT_ALIAS_SW0_GPIOS_PIN
7+
filter: dt_alias_exists("sw0")
88
tags: usb

tests/drivers/gpio/gpio_basic_api/testcase.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ tests:
33
tags: drivers gpio
44
depends_on: gpio
55
harness: loopback # see documentation
6-
filter: DT_ALIAS_GPIO_0_LABEL or DT_ALIAS_GPIO_1_LABEL
6+
filter: dt_alias_exists("gpio-0") or dt_alias_exists("gpio-1")

tests/drivers/i2c/i2c_api/testcase.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ tests:
33
depends_on: i2c
44
tags: drivers i2c
55
harness: sensor
6-
filter: DT_ALIAS_I2C_0_LABEL or DT_ALIAS_I2C_1_LABEL or DT_ALIAS_I2C_2_LABEL
6+
filter: dt_alias_exists("i2c-0") or
7+
dt_alias_exists("i2c-1") or
8+
dt_alias_exists("i2c-2")

tests/drivers/pinmux/pinmux_basic_api/testcase.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ tests:
22
peripheral.pinmux:
33
tags: drivers
44
harness: loopback
5-
filter: DT_ALIAS_GPIO_0_LABEL or DT_ALIAS_GPIO_1_LABEL
5+
filter: dt_alias_exists("gpio-0") or dt_alias_exists("gpio-1")
66
depends_on: gpio
77

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
tests:
22
peripheral.pwm:
33
tags: drivers pwm
4-
filter: DT_ALIAS_PWM_0_LABEL or DT_ALIAS_PWM_1_LABEL or DT_ALIAS_PWM_2_LABEL or DT_ALIAS_PWM_3_LABEL
4+
filter: dt_alias_exists("pwm-0") or
5+
dt_alias_exists("pwm-1") or
6+
dt_alias_exists("pwm-2") or
7+
dt_alias_exists("pwm-3")
58
depends_on: pwm

0 commit comments

Comments
 (0)