platform_external_dtc/tests/fdtdump-runtest.sh
Marc-André Lureau aa522da9ff tests: allow out-of-tree test run
meson runs out-of-tree, add absolute path location where necessary.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20191009102025.10179-3-marcandre.lureau@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-10-14 16:19:29 +11:00

31 lines
562 B
Bash
Executable file

#! /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