Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / test / harness.sh
blob1a0c775ad3c4886b8770905f7d0dcc13061b6297
1 #!/bin/sh
3 tests="$@"
4 test -z "$tests" && tests=`echo t-*.sh`
6 for t in $tests; do
7 printf "Running %-40s" "$t ..."
8 out=`bash ./$t 2>&1`
9 ret=$?
10 if test $ret = 0; then
11 echo " passed."
12 elif test $ret = 200; then
13 skipped="$skipped $t"
14 echo " skipped."
15 else
16 echo " FAILED!"
17 len=`echo $t | wc -c`
18 # fancy formatting...
19 printf -- "--- Output: $t -"
20 for i in `seq $(($len + 14)) 78`; do echo -n "-"; done; echo
21 printf "%s\n" "$out"
22 printf -- "--- End: $t ----"
23 for i in `seq $(($len + 14)) 78`; do echo -n "-"; done; echo
24 failed="$failed $t"
26 done
28 if test -n "$failed"; then
29 echo "Tests skipped:"
30 for t in $skipped; do
31 printf "\t%s\n" $t
32 done
33 echo "TESTS FAILED:"
34 for t in $failed; do
35 printf "\t%s\n" $t
36 done
37 exit 1
38 else
39 echo "All tests passed."