tests: quiet successful tests

feature/tap-sh
William Pitcock 2012-07-25 17:47:09 -05:00
parent 7b10816cdb
commit a15d5eefeb
1 changed files with 14 additions and 7 deletions

View File

@ -7,10 +7,11 @@ failed=0
run_test() {
local res t_ret 2>/dev/null || true
local cmdline 2>/dev/null || true
echo "$ ${1}"
eval res="\$(${1})"
echo "${res}"
cmdline="${1}"
eval res="\$(${1})" 2>/dev/null
t_ret=0
while [ ${#} -gt 1 ]; do
@ -20,20 +21,24 @@ run_test() {
*${1}*)
;;
*)
echo "! expected ${1}"
echo
echo "***********************"
echo "!!! Test $done failed."
echo "!!! $ ${cmdline}"
echo "!!! ${res}"
echo "!!! expected '${1}' in output"
echo "***********************"
t_ret=1
;;
esac
done
if [ ${t_ret} -eq 0 ]; then
echo "+ [OK]"
echo -n "."
else
failed=$(( failed + 1 ))
fi
done=$(( done + 1 ))
echo
}
selfdir=$(cd "$(dirname "${0}")"; pwd)
@ -164,6 +169,8 @@ if [ "x@STRICT_MODE@" == "xno" ]; then
'-lfoo' '-I/usr/include/foo' '-fPIC'
fi
echo
if [ ${failed} -gt 0 ]; then
echo "${failed} of ${done} tests failed. See output for details." >&2
exit 1