samples: can: filter out tests if zephyr,canbus not enabled
- Filter out the remaining CAN tests if no zephyr,canbus chosen node is
enabled in the devicetree.
- Rename the tests to shorten the name a bit.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
diff --git a/samples/drivers/can/sample.yaml b/samples/drivers/can/sample.yaml
index 52db5f9..c40f874 100644
--- a/samples/drivers/can/sample.yaml
+++ b/samples/drivers/can/sample.yaml
@@ -2,8 +2,9 @@
name: CAN driver sample
tests:
sample.drivers.can:
- tags: CAN
+ tags: can
depends_on: can
+ filter: dt_chosen_enabled("zephyr,canbus")
harness: console
harness_config:
type: one_line
diff --git a/samples/net/sockets/can/sample.yaml b/samples/net/sockets/can/sample.yaml
index 7a3e916..9907ee3 100644
--- a/samples/net/sockets/can/sample.yaml
+++ b/samples/net/sockets/can/sample.yaml
@@ -1,14 +1,14 @@
+sample:
+ name: SocketCAN sample
common:
- tags: net socket can CAN
+ tags: net socket can
+ filter: dt_chosen_enabled("zephyr,canbus")
depends_on: can
harness: can
-sample:
- description: Test BSD sockets CAN support
- name: Socket CAN example
tests:
- sample.net.sockets.can.test_with_one_socket:
+ sample.net.sockets.can.one_socket:
extra_configs:
- CONFIG_NET_SOCKETS_CAN_RECEIVERS=1
- sample.net.sockets.can.test_with_two_sockets:
+ sample.net.sockets.can.two_sockets:
extra_configs:
- CONFIG_NET_SOCKETS_CAN_RECEIVERS=2
diff --git a/samples/subsys/canbus/isotp/sample.yaml b/samples/subsys/canbus/isotp/sample.yaml
index 1233a5b..1d33262 100644
--- a/samples/subsys/canbus/isotp/sample.yaml
+++ b/samples/subsys/canbus/isotp/sample.yaml
@@ -2,8 +2,9 @@
name: ISO-TP lib sample
tests:
sample.subsys.canbus.isotp:
- tags: CAN
+ tags: can
depends_on: can
+ filter: dt_chosen_enabled("zephyr,canbus")
harness: console
harness_config:
type: one_line