platform_external_dtc/tests/fdtget-runtest.sh
David Gibson c879a8a28b Factor signal checks out of test scripts
Several test scripts now have some code to check for a program returning
a signal, and reporting a suitable failure.  This patch moves this
duplicated code into a helper function in tests.sh.  At the same time we
remove a bashism found in the current copies (using the non portablr $[ ]
construct for arithmetic).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-02-03 08:38:40 -06:00

30 lines
362 B
Bash
Executable file

#! /bin/sh
. ./tests.sh
LOG=tmp.log.$$
EXPECT=tmp.expect.$$
rm -f $LOG $EXPECT
trap "rm -f $LOG $EXPECT" 0
expect="$1"
echo "$expect" >$EXPECT
shift
verbose_run_log "$LOG" $VALGRIND "$DTGET" "$@"
ret="$?"
if [ "$ret" -ne 0 -a "$expect" = "ERR" ]; then
PASS
fi
FAIL_IF_SIGNAL $ret
diff $EXPECT $LOG
ret="$?"
if [ "$ret" -eq 0 ]; then
PASS
else
FAIL
fi