From b433db0fc74bc7b4c04fcfb014bfaac0f5f29a14 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 7 Nov 2007 10:34:06 +1100 Subject: [PATCH] dtc: Add testcases exercising -Odts mode This patch adds a batch of testcases exercising dtc's -Odts mode. Specifically it checks that using dtc to convert dtb->dts->dtb preserves the original dtb for a number of example dtb files. Signed-off-by: David Gibson --- tests/Makefile.tests | 2 +- tests/run_tests.sh | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/Makefile.tests b/tests/Makefile.tests index 68324e9..8ee0e5d 100644 --- a/tests/Makefile.tests +++ b/tests/Makefile.tests @@ -23,7 +23,7 @@ TESTS_TARGETS = $(TESTS) $(TESTS_TREES) TESTS_DEPFILES = $(TESTS:%=%.d) $(TESTS_PREFIX)testutils.d -TESTS_CLEANFILES_L = *.output vgcore.* *.dtb +TESTS_CLEANFILES_L = *.output vgcore.* *.dtb *.test.dts TESTS_CLEANFILES = $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%) BIN += $(TESTS) $(TESTS_PREFIX)dumptrees diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 278008b..5cf849b 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -82,7 +82,7 @@ libfdt_tests () { done # v16 and alternate layout tests - for tree in test_tree1.dtb; do + for tree in test_tree1.dtb sw_tree1.test.dtb; do for version in 17 16; do for layout in $ALL_LAYOUTS; do run_test mangle-layout $tree $version $layout @@ -93,7 +93,7 @@ libfdt_tests () { done # Read-write tests - for basetree in test_tree1.dtb; do + for basetree in test_tree1.dtb sw_tree1.test.dtb; do for version in 17 16; do for layout in $ALL_LAYOUTS; do tree=v$version.$layout.$basetree @@ -125,6 +125,13 @@ dtc_tests () { run_test dtc.sh -I dts -O dtb -o dtc_escapes.test.dtb escapes.dts run_test string_escapes dtc_escapes.test.dtb + + # Check -Odts mode preserve all dtb information + for tree in test_tree1.dtb dtc_tree1.test.dtb dtc_escapes.test.dtb ; do + run_test dtc.sh -I dtb -O dts -o odts_$tree.test.dts $tree + run_test dtc.sh -I dts -O dtb -o odts_$tree.test.dtb odts_$tree.test.dts + run_test dtbs_equal_ordered $tree odts_$tree.test.dtb + done } while getopts "vdt:" ARG ; do @@ -143,7 +150,7 @@ if [ -z "$TESTSETS" ]; then fi # Make sure we don't have stale blobs lying around -rm -f *.test.dtb +rm -f *.test.dtb *.test.dts for set in $TESTSETS; do case $set in