6 usage: $0 [-n] [test number]
17 --help) print_usage ;;
18 -n) no_cleanup=true; shift ;;
19 *) perform_number=$1; shift ;;
23 # Be Bourne compatible
24 # -- followings are derived from configure script generated by autoconf 2.59 --
25 if test -n "${ZSH_VERSION+set}" && (emulate ksh) >/dev/null 2>&1; then
28 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
29 # is contrary to our usage. Disable this feature.
30 alias -g '${1+"$@"}'='"$@"'
31 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
34 DUALCASE=1; export DUALCASE # for MKS sh
36 : ${lha_dir=@top_builddir@/src}
37 : ${lha_cmd=$(cd $lha_dir && pwd)/lha}
39 : ${builddir=$(cd @builddir@ && pwd)}
41 if [[ x$no_cleanup = x ]]; then
42 trap '_stat=$?; chmod -R 755 test-* 2>/dev/null;
43 rm -rf test-*; exit $_stat' 0 1 2 3 15
46 typeset -i i # for loop
47 typeset -i test_number=0 error_num=0
58 echo "$ lha $@" >&5 # for logging (stdout(fd 1) may be redirected)
70 ((test_number = test_number + 1))
71 typeset exit_status=$1
73 if [[ $exit_status -eq 0 ]]; then
74 echo "$FILENAME #$test_number ... ok" >&2
75 echo "$FILENAME #$test_number ... ok at line $lineno"
77 message "$FILENAME #$test_number ... failed at line $lineno"
78 ((error_num = error_num + 1))
79 error_tests="$error_tests $FILENAME #$test_number"
84 # On HP-UX 11.23, "chmod -R" cannot change the file permission in
85 # non-writable and non-executable directory.
88 typeset mode="$1"; shift
92 test -d "$x" && (cd "$x" && chmod_R $mode *)
98 if [[ x$no_cleanup = x ]]; then
99 chmod_R 755 test-tmp* 2>/dev/null
106 # the `FILENAME' variable should be set the each test filename.
107 FILENAME=$1 test_number=0
118 typeset time=$1; shift
120 # assume that `touch' command supports POSIX's -t switch.
122 # -t [[CC]YY]MMDDhhmm[.ss]
129 identical_timestamp()
131 test "$1" -nt "$2" || test "$1" -ot "$2"
137 message testing $lha_cmd
138 message `$lha --version 2>&1`
140 testsuite lha-test1 # create test data. it is needed for each test
142 if [[ $perform_number != "" ]] && [[ $perform_number != all ]]; then
143 testsuite lha-test$perform_number
149 #testsuite lha-test6 # this feature was removed.
152 #testsuite lha-test9 # incomplete
157 case `$lha --version 2>&1` in
158 *djgpp* | *-pc-mingw*)
159 # No symlink support on DJGPP and MinGW
160 message testing to handle symbolic links ... skip
171 # followings will take a long time
172 if [[ $perform_number = all ]]; then
173 testsuite lha-test51 # extract 2G over files
174 testsuite lha-test52 # extract 4G over files
178 if (( $error_num != 0 )); then
179 message $error_num tests failed!
180 message test number: $error_tests
182 message All tests succeeded.