[PATCH] Added test cases for target references

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



This commit adds test cases for commits "Correct overlay syntactic
sugar for generating target-path fragments" and "Merge nodes with
local target label references".

It verifies that target path references are not resolved locally and
that target label references that can be resolved locally are.

Signed-off-by: Fredrik Markstrom <fredrik.markstrom@xxxxxxxxx>
---

This is a humble first try, feedback on what we need more and how it
should be done are most welcome. The options are infinite.

 tests/overlay_overlay_local_merge.dts | 31 +++++++++++++++++++++++++++
 tests/run_tests.sh                    |  5 +++++
 2 files changed, 36 insertions(+)
 create mode 100644 tests/overlay_overlay_local_merge.dts

diff --git a/tests/overlay_overlay_local_merge.dts b/tests/overlay_overlay_local_merge.dts
new file mode 100644
index 0000000..b926820
--- /dev/null
+++ b/tests/overlay_overlay_local_merge.dts
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 NextThing Co
+ * Copyright (c) 2016 Free Electrons
+ * Copyright (c) 2016 Konsulko Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/dts-v1/;
+/plugin/;
+
+&test {
+      parent: new-node {
+      	     parent-property;
+      };
+};
+
+&parent {
+	new-merged-property;
+	new-merged-node {
+		new-property;
+	};
+};
+
+&{/} {
+	new-root-node {
+		new-root-node-property;
+	};
+};
+
+
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 6756f3d..e3e64e8 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -257,6 +257,11 @@ dtc_overlay_tests () {
     run_test check_path overlay_overlay_bypath.test.dtb not-exists "/__fixups__"
     run_test check_path overlay_overlay_bypath.test.dtb exists "/__local_fixups__"
 
+    # Make sure local target references are resolved and nodes are merged and that path references are not
+    run_dtc_test -I dts -O dtb -o overlay_overlay_local_merge.test.dtb overlay_overlay_local_merge.dts
+    run_test check_path overlay_overlay_local_merge.test.dtb exists "/fragment@0/__overlay__/new-node/new-merged-node"
+    run_test check_path overlay_overlay_local_merge.test.dtb exists "/fragment@1/__overlay__/new-root-node"
+
     # Check building works the same as manual constructions
     run_test dtbs_equal_ordered overlay_overlay.test.dtb overlay_overlay_nosugar.test.dtb
 
-- 
2.17.1




[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux