6 -n) no_cleanup=true; shift ;;
7 *) perform_number=$1; shift ;;
11 # Be Bourne compatible
12 # -- followings are derived from configure script generated by autoconf 2.59 --
13 if test -n "${ZSH_VERSION+set}" && (emulate ksh) >/dev/null 2>&1; then
16 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
17 # is contrary to our usage. Disable this feature.
18 alias -g '${1+"$@"}'='"$@"'
19 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
22 DUALCASE=1; export DUALCASE # for MKS sh
24 : ${lha_dir=@top_builddir@/src}
25 : ${lha_cmd=$(cd $lha_dir && pwd)/lha}
27 : ${builddir=$(cd @builddir@ && pwd)}
29 if [[ x$no_cleanup = x ]]; then
30 trap '_stat=$?; rm -rf test-*; exit $_stat' 0 1 2 3 15
33 typeset -i i # for loop
34 typeset -i test_number=0 error_num=0
45 echo "$ lha $@" >&5 # for logging (stdout(fd 1) may be redirected)
57 ((test_number = test_number + 1))
58 typeset exit_status=$1
60 if [[ $exit_status -eq 0 ]]; then
61 echo "$FILENAME #$test_number ... ok" >&2
62 echo "$FILENAME #$test_number ... ok at line $lineno"
64 message "$FILENAME #$test_number ... failed at line $lineno"
65 ((error_num = error_num + 1))
66 error_tests="$error_tests $FILENAME #$test_number"
73 if [[ x$no_cleanup = x ]]; then
80 # the `FILENAME' variable should be set the each test filename.
81 FILENAME=$1 test_number=0
92 typeset time=$1; shift
94 # assume that `touch' command supports POSIX's -t switch.
96 # -t [[CC]YY]MMDDhhmm[.ss]
105 message testing $lha_cmd
106 message `$lha --version 2>&1`
108 testsuite lha-test1 # create test data. it is needed for each test
110 if [[ $perform_number != "" ]]; then
111 testsuite lha-test$perform_number
117 #testsuite lha-test6 # this feature was removed.
120 #testsuite lha-test9 # incomplete
125 case `$lha --version 2>&1` in
126 *djgpp* | *-pc-mingw*)
127 # No symlink support on DJGPP and MinGW
128 message testing to handle symbolic links ... skip
138 if (( $error_num != 0 )); then
139 message $error_num tests failed!
140 message test number: $error_tests