Browse Source

tests: Add test cases for bad endpoint node and remote-endpoint prop checks

Signed-off-by: Johannes Beisswenger <johannes.beisswenger@cetitec.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Johannes Beisswenger 2 years ago committed by David Gibson
parent
commit
f1657b2fb5
  1. 7
      tests/bad-graph-root1.dts
  2. 2
      tests/bad-graph-root2.dts
  3. 14
      tests/bad-graph-root3.dts
  4. 19
      tests/bad-graph-root4.dts
  5. 4
      tests/run_tests.sh

7
tests/bad-graph-root1.dts

@ -0,0 +1,7 @@
/dts-v1/;

/ {
foo {
remote-endpoint = <0xdeadbeef>;
};
};

2
tests/bad-graph-root2.dts

@ -0,0 +1,2 @@
/dts-v1/;
/ { endpoint {}; };

14
tests/bad-graph-root3.dts

@ -0,0 +1,14 @@
/dts-v1/;

/ {
bar: bar {
port {
bar_con: endpoint {
remote-endpoint = <&foo_con>;
};
};
};
foo_con: endpoint {
remote-endpoint = <&bar_con>;
};
};

19
tests/bad-graph-root4.dts

@ -0,0 +1,19 @@
/dts-v1/;

/ {

bar: bar {
port {
bar_con: endpoint {
remote-endpoint = <&foo_con>;
};
};
};
foo {
remote-endpoint = <&bar_con>; // misplaced remote-endpoint property
port {
foo_con: endpoint {
};
};
};
};

4
tests/run_tests.sh

@ -730,6 +730,10 @@ dtc_tests () {
check_tests "$SRCDIR/bad-graph.dts" graph_child_address check_tests "$SRCDIR/bad-graph.dts" graph_child_address
check_tests "$SRCDIR/bad-graph.dts" graph_port check_tests "$SRCDIR/bad-graph.dts" graph_port
check_tests "$SRCDIR/bad-graph.dts" graph_endpoint check_tests "$SRCDIR/bad-graph.dts" graph_endpoint
check_tests "$SRCDIR/bad-graph-root1.dts" graph_nodes
check_tests "$SRCDIR/bad-graph-root2.dts" graph_nodes
check_tests "$SRCDIR/bad-graph-root3.dts" graph_nodes
check_tests "$SRCDIR/bad-graph-root4.dts" graph_nodes
run_sh_test "$SRCDIR/dtc-checkfails.sh" deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/bad-gpio.dts" run_sh_test "$SRCDIR/dtc-checkfails.sh" deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/bad-gpio.dts"
run_sh_test "$SRCDIR/dtc-checkfails.sh" -n deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/good-gpio.dts" run_sh_test "$SRCDIR/dtc-checkfails.sh" -n deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/good-gpio.dts"
check_tests "$SRCDIR/bad-interrupt-cells.dts" interrupts_property check_tests "$SRCDIR/bad-interrupt-cells.dts" interrupts_property

Loading…
Cancel
Save