Browse Source
This patch adds a handful of simple testcases for dtc. It adds a dts file which should generate the same sample tree as is used for the libfdt testcases, and tests invoking dtc on this dts, plus the standard batch of libfdt cases on the resulting dtb, which effectively checks that the dtb is correct. Because the test framework assumes each testcase is an executable with the right output conventions, we use a little shell script, dtc.sh, as a wrapper around dtc itself. It simply invokes dtc and returns a PASS or FAIL depending on whether dtc returned an error. It's not much, but it's a start. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>main
David Gibson
18 years ago
committed by
Jon Loeliger
4 changed files with 62 additions and 3 deletions
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
#! /bin/sh |
||||
|
||||
PASS () { |
||||
echo "PASS" |
||||
exit 0 |
||||
} |
||||
|
||||
FAIL () { |
||||
echo "FAIL" "$@" |
||||
exit 2 |
||||
} |
||||
|
||||
DTC=../dtc |
||||
|
||||
verbose_run () { |
||||
if [ -z "$QUIET_TEST" ]; then |
||||
"$@" |
||||
else |
||||
"$@" > /dev/null 2> /dev/null |
||||
fi |
||||
} |
||||
|
||||
if verbose_run "$DTC" "$@"; then |
||||
PASS |
||||
else |
||||
ret="$?" |
||||
FAIL "dtc returned error code $ret" |
||||
fi |
Loading…
Reference in new issue