1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00
lvm2/test/harness.sh
2008-09-29 15:59:19 +00:00

34 lines
658 B
Bash

#!/bin/sh
tests="$@"
test -z "$tests" && tests=`echo t-*.sh`
for t in $tests; do
printf "Running %-40s" "$t ..."
out=`sh ./$t 2>&1`
ret=$?
if test $ret = 0; then
echo " passed."
elif test $ret = 200; then
echo " skipped."
else
echo " FAILED!"
len=`echo $t | wc -c`
# fancy formatting...
printf -- "--- Output: $t -"
for i in `seq $(($len + 14)) 78`; do echo -n "-"; done; echo
printf "%s\n" "$out"
for i in `seq 1 78`; do echo -n "-"; done; echo
failed="$failed $t"
fi
done
if test -n "$failed"; then
echo "TESTS FAILED:"
for t in $failed; do
printf "\t%s\n" $t
done
else
echo "All tests passed."
fi