platform_external_dtc/tests/tests.sh
David Gibson fc6e6f8d91 dtc: Remove some small bashisms from test scripts
Some of the helper scripts used to run testcases contain some
constructs that are bashisms.  Or at least which don't work on dash,
the minimal shell used as /bin/sh on recent Ubuntu systems.

This patch removes these constructs so that the testsuite will pass
"out of the box" on systems where /bin/sh is dash.

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

32 lines
397 B
Bash

# Common functions for shell testcases
PASS () {
echo "PASS"
exit 0
}
FAIL () {
echo "FAIL" "$@"
exit 2
}
DTC=../dtc
verbose_run () {
if [ -z "$QUIET_TEST" ]; then
"$@"
else
"$@" > /dev/null 2> /dev/null
fi
}
verbose_run_log () {
LOG="$1"
shift
"$@" > "$LOG" 2>&1
ret=$?
if [ -z "$QUIET_TEST" ]; then
cat "$LOG" >&2
fi
return $ret
}