aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@arm.com>2018-09-11 15:41:31 -0500
committerDavid Gibson <david@gibson.dropbear.id.au>2018-09-13 11:39:03 +1000
commitc86da84d30e4b72cfb4fee22b62bea4257bc14bf (patch)
tree9186e26404171e4a77cd69c3b2ec3afc35cff82c /tests
parent361b5e7d80673e7d3613cfdf989449013bf109a0 (diff)
downloaddtc-c86da84d30e4b72cfb4fee22b62bea4257bc14bf.zip
dtc-c86da84d30e4b72cfb4fee22b62bea4257bc14bf.tar.gz
dtc-c86da84d30e4b72cfb4fee22b62bea4257bc14bf.tar.bz2
Add support for YAML encoded output
YAML encoded DT is useful for validation of DTs using binding schemas. The YAML encoding is an intermediate format used for validation and is therefore subject to change as needed. The YAML output is dependent on DTS input with type information preserved. Signed-off-by: Grant Likely <grant.likely@arm.com> [robh: make YAML support optional, build fixes, Travis CI test, preserve type information in paths and phandles] Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run_tests.sh8
-rw-r--r--tests/type-preservation.dt.yaml20
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index bbdc5c8..adc4dae 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -568,6 +568,14 @@ dtc_tests () {
run_wrap_test cmp $tree $tree.test.dts
done
+ # Check -Oyaml output
+ if pkg-config --exists yaml-0.1; then
+ for tree in type-preservation; do
+ run_dtc_test -I dts -O yaml -o $tree.test.dt.yaml $tree.dts
+ run_wrap_test cmp $tree.dt.yaml $tree.test.dt.yaml
+ done
+ fi
+
# Check version conversions
for tree in test_tree1.dtb ; do
for aver in 1 2 3 16 17; do
diff --git a/tests/type-preservation.dt.yaml b/tests/type-preservation.dt.yaml
new file mode 100644
index 0000000..ee8cfde
--- /dev/null
+++ b/tests/type-preservation.dt.yaml
@@ -0,0 +1,20 @@
+---
+- '#address-cells': [[0x1]]
+ '#size-cells': [[0x0]]
+ subnode@1:
+ compatible: ["subnode1"]
+ reg: [[0x1]]
+ int-array: [[0x0, 0x1], [0x2, 0x3]]
+ int8: [!u8 [0x56]]
+ int8-array: [!u8 [0x0, 0x12, 0x34, 0x56]]
+ int16: [!u16 [0x3210]]
+ int16-array: [!u16 [0x1234, 0x5678, 0x90ab, 0xcdef]]
+ int16-matrix: [!u16 [0x1234, 0x5678], [0x90ab, 0xcdef]]
+ int64: [!u64 [0x200000000]]
+ int64-array: [!u64 [0x100000000, 0x0]]
+ a-string-with-nulls: ["foo\0bar", "baz"]
+ subsubnode:
+ compatible: ["subsubnode1", "subsubnode"]
+ subsubsubnode:
+ compatible: ["subsubsubnode1", [0x1234], "subsubsubnode"]
+...