Skip to content

Commit

Permalink
sample/tests: replace DT_ define filters with dt_ functions
Browse files Browse the repository at this point in the history
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 <kumar.gala@linaro.org>
  • Loading branch information
galak authored and nashif committed Nov 4, 2019
1 parent 7733b94 commit 4cc91fd
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion samples/basic/blink_led/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sample:
tests:
sample.blink_led:
# FIXME: We should remove those and just rely on depends_on
filter: DT_ALIAS_PWM_LED0_PWMS_CONTROLLER
filter: dt_alias_exists("pwm-led0")
tags: drivers pwm
depends_on: pwm
harness: led
2 changes: 1 addition & 1 deletion samples/basic/blinky/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ sample:
tests:
sample.blinky:
tags: LED gpio
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER
filter: dt_compat_enabled_with_alias("gpio-leds", "led0")
depends_on: gpio
harness: led
2 changes: 1 addition & 1 deletion samples/basic/button/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ sample:
tests:
sample.button:
tags: button gpio
filter: DT_GPIO_KEYS_SW0_GPIOS_CONTROLLER
filter: dt_compat_enabled_with_alias("gpio-keys", "sw0")
depends_on: gpio
harness: button
3 changes: 2 additions & 1 deletion samples/basic/disco/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ sample:
name: Disco Lights
tests:
sample.disco:
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and
dt_compat_enabled_with_alias("gpio-leds", "led1")
tags: LED gpio
depends_on: gpio
harness: led
2 changes: 1 addition & 1 deletion samples/basic/fade_led/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ tests:
tags: drivers pwm
depends_on: pwm
harness: led
filter: DT_ALIAS_PWM_LED0_PWMS_CONTROLLER
filter: dt_alias_exists("pwm-led0")
6 changes: 3 additions & 3 deletions samples/basic/rgb_led/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ sample:
name: RGB LED
tests:
sample.rgb_led:
filter: DT_ALIAS_RED_PWM_LED_PWMS_CONTROLLER and
DT_ALIAS_GREEN_PWM_LED_PWMS_CONTROLLER and
DT_ALIAS_BLUE_PWM_LED_PWMS_CONTROLLER
filter: dt_alias_exists("red-pwm-led") and
dt_alias_exists("green-pwm-led") and
dt_alias_exists("blue-pwm-led")
tags: drivers pwm
depends_on: pwm
harness: led
2 changes: 1 addition & 1 deletion samples/basic/servo_motor/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ tests:
tags: drivers pwm
depends_on: pwm
harness: motor
filter: DT_ALIAS_PWM_0_LABEL
filter: dt_alias_exists("pwm-0")
3 changes: 2 additions & 1 deletion samples/basic/threads/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ sample:
tests:
sample.threads:
tags: kernel threads gpio
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and
dt_compat_enabled_with_alias("gpio-leds", "led1")
depends_on: gpio
harness: console
harness_config:
Expand Down
3 changes: 2 additions & 1 deletion samples/drivers/gpio/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ sample:
tests:
sample.driver.gpio:
tags: drivers
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_KEYS_SW0_GPIOS_CONTROLLER
filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and
dt_compat_enabled_with_alias("gpio-keys", "sw0")
harness: console
harness_config:
type: one_line
Expand Down
2 changes: 1 addition & 1 deletion samples/drivers/i2c_fujitsu_fram/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tests:
sample.driver.i2c_fujitsu_fram:
tags: drivers
depends_on: i2c
filter: DT_ALIAS_I2C_0_LABEL
filter: dt_alias_exists("i2c-0")
harness: console
harness_config:
type: one_line
Expand Down
2 changes: 1 addition & 1 deletion samples/drivers/led_apa102c_bitbang/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ sample:
tests:
sample.driver.led_apa102c_bitbang:
tags: LED
filter: DT_ALIAS_GPIO_0_LABEL
filter: dt_alias_exists("gpio-0")
depends_on: gpio
2 changes: 1 addition & 1 deletion samples/drivers/spi_flash/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sample:
tests:
sample.driver.spi_flash:
tags: spi flash
filter: DT_INST_0_JEDEC_SPI_NOR_LABEL
filter: dt_compat_enabled("jedec,spi-nor")
harness: console
harness_config:
type: multi_line
Expand Down
2 changes: 1 addition & 1 deletion samples/subsys/usb/hid-mouse/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ tests:
sample.usb.hid-mouse:
depends_on: usb_device gpio
harness: button
filter: DT_ALIAS_SW0_GPIOS_PIN
filter: dt_alias_exists("sw0")
tags: usb
2 changes: 1 addition & 1 deletion tests/drivers/gpio/gpio_basic_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ tests:
tags: drivers gpio
depends_on: gpio
harness: loopback # see documentation
filter: DT_ALIAS_GPIO_0_LABEL or DT_ALIAS_GPIO_1_LABEL
filter: dt_alias_exists("gpio-0") or dt_alias_exists("gpio-1")
4 changes: 3 additions & 1 deletion tests/drivers/i2c/i2c_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ tests:
depends_on: i2c
tags: drivers i2c
harness: sensor
filter: DT_ALIAS_I2C_0_LABEL or DT_ALIAS_I2C_1_LABEL or DT_ALIAS_I2C_2_LABEL
filter: dt_alias_exists("i2c-0") or
dt_alias_exists("i2c-1") or
dt_alias_exists("i2c-2")
2 changes: 1 addition & 1 deletion tests/drivers/pinmux/pinmux_basic_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ tests:
peripheral.pinmux:
tags: drivers
harness: loopback
filter: DT_ALIAS_GPIO_0_LABEL or DT_ALIAS_GPIO_1_LABEL
filter: dt_alias_exists("gpio-0") or dt_alias_exists("gpio-1")
depends_on: gpio

5 changes: 4 additions & 1 deletion tests/drivers/pwm/pwm_api/testcase.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
tests:
peripheral.pwm:
tags: drivers pwm
filter: DT_ALIAS_PWM_0_LABEL or DT_ALIAS_PWM_1_LABEL or DT_ALIAS_PWM_2_LABEL or DT_ALIAS_PWM_3_LABEL
filter: dt_alias_exists("pwm-0") or
dt_alias_exists("pwm-1") or
dt_alias_exists("pwm-2") or
dt_alias_exists("pwm-3")
depends_on: pwm

0 comments on commit 4cc91fd

Please sign in to comment.