dtc: Testcase for /include/ directive

This patch adds a testcase for the /include/ directive.  It assembles
a sample dts file with many /include/ directives at a variety of
different lexical / grammatical contexts.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2008-06-24 11:21:44 +10:00 committed by Jon Loeliger
parent f8bf4bfc87
commit f8e52fe6d8
10 changed files with 43 additions and 0 deletions

1
tests/include0.dts Normal file
View File

@ -0,0 +1 @@
/include/ "include1.dts"

23
tests/include1.dts Normal file
View File

@ -0,0 +1,23 @@
/dts-v1/;
/include/ "include2.dts"
/memreserve/ /include/ "include3.dts";
/ {
/include/ "include4.dts"
/include/ "include5.dts" = <0xdeadbeef>;
prop-str = /include/ "include6.dts";
/include/ "include7.dts"
subnode@2 {
linux,phandle = <0x2000>;
prop-int = <123456789>;
/include/ "include8.dts"
linux,phandle = <0x2001>;
compatible = "subsubnode2", "subsubnode";
prop-int = <0726746425>;
};
};
};

1
tests/include2.dts Normal file
View File

@ -0,0 +1 @@
/memreserve/ 0xdeadbeef00000000 0x100000;

1
tests/include3.dts Normal file
View File

@ -0,0 +1 @@
123456789 010000

1
tests/include4.dts Normal file
View File

@ -0,0 +1 @@
compatible = "test_tree1";

1
tests/include5.dts Normal file
View File

@ -0,0 +1 @@
prop-int

1
tests/include6.dts Normal file
View File

@ -0,0 +1 @@
"hello world"

9
tests/include7.dts Normal file
View File

@ -0,0 +1,9 @@
subnode@1 {
compatible = "subnode1";
prop-int = [deadbeef];
subsubnode {
compatible = "subsubnode1", "subsubnode";
prop-int = <0xdeadbeef>;
};
};

1
tests/include8.dts Normal file
View File

@ -0,0 +1 @@
subsubnode@0 {

View File

@ -206,6 +206,10 @@ dtc_tests () {
run_dtc_test -I dts -O dtb -o dtc_comments-cmp.test.dtb comments-cmp.dts
run_test dtbs_equal_ordered dtc_comments.test.dtb dtc_comments-cmp.test.dtb
# Check /include/ directive
run_dtc_test -I dts -O dtb -o includes.test.dtb include0.dts
run_test dtbs_equal_ordered includes.test.dtb test_tree1.dtb
# Check /incbin/ directive
run_dtc_test -I dts -O dtb -o incbin.test.dtb incbin.dts
run_test incbin incbin.test.dtb