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 <david@gibson.dropbear.id.au>
main
David Gibson 2007-11-07 10:34:06 +11:00 committed by Jon Loeliger
parent d3ea6e5f96
commit b433db0fc7
2 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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