Browse Source

tests: Add a test case for the omit-if-no-ref keyword

The newly introduced /omit-if-no-ref/ needs a few test cases, make
sure to test them.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Maxime Ripard 7 years ago committed by David Gibson
parent
commit
84e414b0b5
  1. 26
      tests/omit-no-ref.dts
  2. 7
      tests/run_tests.sh

26
tests/omit-no-ref.dts

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

/ {
test-phandle = <&node3>;
test-path = &node4;

/omit-if-no-ref/ node1: node1 {
bar = <0xdeadbeef>;
};

node2: node2 {
foo = <0x42>;
};

node3: node3 {
test = "test";
};

node4: node4 {
test;
};
};

/omit-if-no-ref/ &node2;
/omit-if-no-ref/ &node3;
/omit-if-no-ref/ &node4;

7
tests/run_tests.sh

@ -568,6 +568,13 @@ dtc_tests () {
run_dtc_test -I dts -O dtb -o dtc_tree1_delete.test.dtb test_tree1_delete.dts run_dtc_test -I dts -O dtb -o dtc_tree1_delete.test.dtb test_tree1_delete.dts
tree1_tests dtc_tree1_delete.test.dtb tree1_tests dtc_tree1_delete.test.dtb


# Check omit-if-no-ref functionality
run_dtc_test -I dts -O dtb -o omit-no-ref.test.dtb omit-no-ref.dts
run_test check_path omit-no-ref.test.dtb not-exists "/node1"
run_test check_path omit-no-ref.test.dtb not-exists "/node2"
run_test check_path omit-no-ref.test.dtb exists "/node3"
run_test check_path omit-no-ref.test.dtb exists "/node4"

run_dtc_test -I dts -O dts -o delete_reinstate_multilabel.dts.test.dts delete_reinstate_multilabel.dts run_dtc_test -I dts -O dts -o delete_reinstate_multilabel.dts.test.dts delete_reinstate_multilabel.dts
run_wrap_test cmp delete_reinstate_multilabel.dts.test.dts delete_reinstate_multilabel_ref.dts run_wrap_test cmp delete_reinstate_multilabel.dts.test.dts delete_reinstate_multilabel_ref.dts



Loading…
Cancel
Save