Files
android_external_dtc/tests/dtc-checkfails.sh
David Gibson 68fe10ba4e dtc: Assorted improvements to test harness
This patch makes several small improvements to the test harness.

* An altered way of invoking shell script testcases from run_tests.sh
  means scripts no longer need to me marked executable in the
  repository to work properly.

* dtc.sh never did anything that was really dtc specific - with the
  exception of messages, it would work equally well for any binary
  that returns 0 in the successful case.  Therefore, generalise dtc.sh
  and fold it into run_tests.sh so we don't need a separate script any
  more.

* Tweak various things so that the valgrind options are properly
  propagated down to invoke dtc under valgrind when called via wrapper
  scripts.

* Tweak the valgrind suppressions to work properly on a wider range of
  systems (this was necessary on my machine running Ubuntu Hardy).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-03-23 08:00:33 -05:00

34 lines
485 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 $TMPFILE $LOG
verbose_run_log "$LOG" $VALGRIND "$DTC" -o /dev/null "$@"
ret="$?"
if [ "$ret" -gt 127 ]; then
signame=$(kill -l $[ret - 128])
FAIL "Killed by SIG$signame"
fi
for c in $CHECKS; do
if ! grep -E "^(ERROR)|(Warning) \($c\):" $LOG > /dev/null; then
FAIL "Failed to trigger check \"$c\""
fi
done
rm -f $LOG
PASS