summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2008-06-24 11:21:44 +1000
committerJon Loeliger <jdl@jdl.com>2008-07-14 12:07:14 -0500
commitf8e52fe6d87cadbaf0b440073fb9137bef36ee98 (patch)
treea8acc8e765f94e7c7e13043f5f71f33de512a994
parentf8bf4bfc8796b46e6086a52f0cd6c1f9ed58645a (diff)
downloaddtc-f8e52fe6d87cadbaf0b440073fb9137bef36ee98.tar.gz
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>
-rw-r--r--tests/include0.dts1
-rw-r--r--tests/include1.dts23
-rw-r--r--tests/include2.dts1
-rw-r--r--tests/include3.dts1
-rw-r--r--tests/include4.dts1
-rw-r--r--tests/include5.dts1
-rw-r--r--tests/include6.dts1
-rw-r--r--tests/include7.dts9
-rw-r--r--tests/include8.dts1
-rwxr-xr-xtests/run_tests.sh4
10 files changed, 43 insertions, 0 deletions
diff --git a/tests/include0.dts b/tests/include0.dts
new file mode 100644
index 0000000..355ed6a
--- /dev/null
+++ b/tests/include0.dts
@@ -0,0 +1 @@
+/include/ "include1.dts"
diff --git a/tests/include1.dts b/tests/include1.dts
new file mode 100644
index 0000000..0c7f42e
--- /dev/null
+++ b/tests/include1.dts
@@ -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>;
+ };
+ };
+};
diff --git a/tests/include2.dts b/tests/include2.dts
new file mode 100644
index 0000000..7e189dd
--- /dev/null
+++ b/tests/include2.dts
@@ -0,0 +1 @@
+/memreserve/ 0xdeadbeef00000000 0x100000;
diff --git a/tests/include3.dts b/tests/include3.dts
new file mode 100644
index 0000000..ee9d277
--- /dev/null
+++ b/tests/include3.dts
@@ -0,0 +1 @@
+123456789 010000
diff --git a/tests/include4.dts b/tests/include4.dts
new file mode 100644
index 0000000..b2ddbe5
--- /dev/null
+++ b/tests/include4.dts
@@ -0,0 +1 @@
+ compatible = "test_tree1";
diff --git a/tests/include5.dts b/tests/include5.dts
new file mode 100644
index 0000000..9a35dc5
--- /dev/null
+++ b/tests/include5.dts
@@ -0,0 +1 @@
+prop-int
diff --git a/tests/include6.dts b/tests/include6.dts
new file mode 100644
index 0000000..cd4bc1a
--- /dev/null
+++ b/tests/include6.dts
@@ -0,0 +1 @@
+"hello world"
diff --git a/tests/include7.dts b/tests/include7.dts
new file mode 100644
index 0000000..fa726f9
--- /dev/null
+++ b/tests/include7.dts
@@ -0,0 +1,9 @@
+ subnode@1 {
+ compatible = "subnode1";
+ prop-int = [deadbeef];
+
+ subsubnode {
+ compatible = "subsubnode1", "subsubnode";
+ prop-int = <0xdeadbeef>;
+ };
+ };
diff --git a/tests/include8.dts b/tests/include8.dts
new file mode 100644
index 0000000..ec70064
--- /dev/null
+++ b/tests/include8.dts
@@ -0,0 +1 @@
+subsubnode@0 { \ No newline at end of file
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 3b78f8d..ed0c450 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -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