diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /dtc/tests/fdtdump-runtest.sh | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'dtc/tests/fdtdump-runtest.sh')
-rwxr-xr-x | dtc/tests/fdtdump-runtest.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dtc/tests/fdtdump-runtest.sh b/dtc/tests/fdtdump-runtest.sh new file mode 100755 index 000000000..71ac86147 --- /dev/null +++ b/dtc/tests/fdtdump-runtest.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +# Arguments: +# $1 - source file to compile and compare with fdtdump output of the +# compiled file. + +SRCDIR=`dirname "$0"` +. "$SRCDIR/testutils.sh" + +dts="$1" +dtb="${dts}.dtb" +out="${dts}.out" +LOG=tmp.log.$$ + +files="$dtb $out $LOG" + +rm -f $files +trap "rm -f $files" 0 + +verbose_run_log_check "$LOG" $VALGRIND $DTC -O dtb $dts -o $dtb +$FDTDUMP ${dtb} | grep -v "//" >${out} + +if diff -w $dts $out >/dev/null; then + PASS +else + if [ -z "$QUIET_TEST" ]; then + echo "DIFF :-:" + diff -u -w $dts $out + fi + FAIL "Results differ from expected" +fi |