#!/bin/bash
+print_usage()
+{
+ cat <<EOF
+usage: $0 [-n] [test number]
+
+option:
+ -n: do not cleanup.
+EOF
+ exit
+}
+
for _opt
do
case $_opt in
+ --help) print_usage ;;
-n) no_cleanup=true; shift ;;
*) perform_number=$1; shift ;;
esac
: ${builddir=$(cd @builddir@ && pwd)}
if [[ x$no_cleanup = x ]]; then
- trap '_stat=$?; rm -rf test-*; exit $_stat' 0 1 2 3 15
+ trap '_stat=$?; chmod -R 755 test-* 2>/dev/null;
+ rm -rf test-*; exit $_stat' 0 1 2 3 15
fi
typeset -i i # for loop
fi
}
+# On HP-UX 11.23, "chmod -R" cannot change the file permission in
+# non-writable and non-executable directory.
+chmod_R()
+{
+ typeset mode="$1"; shift
+ for x in "$@"
+ do
+ chmod $mode "$x"
+ test -d "$x" && (cd "$x" && chmod_R $mode *)
+ done
+}
+
cleanup()
{
if [[ x$no_cleanup = x ]]; then
+ chmod_R 755 test-tmp* 2>/dev/null
rm -rf test-tmp*
fi
}
# touch $time "$@"
}
+identical_timestamp()
+{
+ test "$1" -nt "$2" || test "$1" -ot "$2"
+ test $? -ne 0
+}
+
# test start
message testing $lha_cmd
;;
*)
testsuite lha-test14
+ ;;
esac
testsuite lha-test15
testsuite lha-test16
testsuite lha-test17
+ testsuite lha-test18
+ testsuite lha-test19
# followings will take a long time
if [[ $perform_number = all ]]; then
testsuite lha-test51 # extract 2G over files
if (( $error_num != 0 )); then
message $error_num tests failed!
message test number: $error_tests
+else
+ message All tests succeeded.
fi
exit $result