summaryrefslogtreecommitdiff
path: root/tests/overlay_overlay_nosugar.dts
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2018-03-06 13:45:23 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-03-06 13:45:36 +1100
commit119e27300359b309e27bfd94b506ea5ad24f1cfc (patch)
tree0719356b88003a89f4041a091bd1c79ebfccbf89 /tests/overlay_overlay_nosugar.dts
parentaadd0b65c987d21776354800fdf24ad35c0ffe68 (diff)
downloaddevice-tree-compiler-119e27300359b309e27bfd94b506ea5ad24f1cfc.tar.gz
Improve tests for dtc overlay generation
So far, the tests for generating runtime overlays with dtc weren't checking the syntactic sugar. This adds such a test. Furthermore the existing tests were only minimally testing dtc's output for the overlay. This adds a test comparing the dtc output with the more or less manually constructed overlays we already have for testing libfdt's overlay application code. This does require some minor changes to that manually constructed overlay which don't change the sematics but re-order / rename things to match the way dtc does it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/overlay_overlay_nosugar.dts')
-rw-r--r--tests/overlay_overlay_nosugar.dts86
1 files changed, 86 insertions, 0 deletions
diff --git a/tests/overlay_overlay_nosugar.dts b/tests/overlay_overlay_nosugar.dts
new file mode 100644
index 0000000..b6d841b
--- /dev/null
+++ b/tests/overlay_overlay_nosugar.dts
@@ -0,0 +1,86 @@
+/*
+ * 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 that we can change an int by another */
+ fragment@0 {
+ target = <&test>;
+
+ __overlay__ {
+ test-int-property = <43>;
+ };
+ };
+
+ /* Test that we can replace a string by a longer one */
+ fragment@1 {
+ target = <&test>;
+
+ __overlay__ {
+ test-str-property = "foobar";
+ };
+ };
+
+ /* Test that we add a new property */
+ fragment@2 {
+ target = <&test>;
+
+ __overlay__ {
+ test-str-property-2 = "foobar2";
+ };
+ };
+
+ /* Test that we add a new node (by phandle) */
+ fragment@3 {
+ target = <&test>;
+
+ __overlay__ {
+ new-node {
+ new-property;
+ };
+ };
+ };
+
+ fragment@5 {
+ target = <&test>;
+
+ __overlay__ {
+ local: new-local-node {
+ new-property;
+ };
+ };
+ };
+
+ fragment@6 {
+ target = <&test>;
+
+ __overlay__ {
+ test-phandle = <&test>, <&local>;
+ };
+ };
+
+ fragment@7 {
+ target = <&test>;
+
+ __overlay__ {
+ test-several-phandle = <&local>, <&local>;
+ };
+ };
+
+ fragment@8 {
+ target = <&test>;
+
+ __overlay__ {
+ sub-test-node {
+ new-sub-test-property;
+ };
+ };
+ };
+};