c879a8a28b
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>
28 lines
403 B
Bash
Executable file
28 lines
403 B
Bash
Executable file
#! /bin/sh
|
|
|
|
. ./tests.sh
|
|
|
|
for x; do
|
|
shift
|
|
if [ "$x" = "--" ]; then
|
|
break;
|
|
fi
|
|
CHECKS="$CHECKS $x"
|
|
done
|
|
|
|
LOG=tmp.log.$$
|
|
rm -f $LOG
|
|
trap "rm -f $LOG" 0
|
|
|
|
verbose_run_log "$LOG" $VALGRIND "$DTC" -o /dev/null "$@"
|
|
ret="$?"
|
|
|
|
FAIL_IF_SIGNAL $ret
|
|
|
|
for c in $CHECKS; do
|
|
if ! grep -E "^(ERROR)|(Warning) \($c\):" $LOG > /dev/null; then
|
|
FAIL "Failed to trigger check \"$c\""
|
|
fi
|
|
done
|
|
|
|
PASS
|