File: fdtdump-runtest.sh

package info (click to toggle)
device-tree-compiler 1.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,116 kB
  • sloc: ansic: 13,916; sh: 1,200; asm: 713; lex: 522; python: 507; yacc: 499; makefile: 313; perl: 74
file content (31 lines) | stat: -rwxr-xr-x 562 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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