equal
deleted
inserted
replaced
25 failed=0 |
25 failed=0 |
26 |
26 |
27 HGTMP="" |
27 HGTMP="" |
28 cleanup_exit() { |
28 cleanup_exit() { |
29 rm -rf "$HGTMP" |
29 rm -rf "$HGTMP" |
30 exit $1 |
|
31 } |
30 } |
32 |
31 |
33 # Remove temporary files even if we get interrupted |
32 # Remove temporary files even if we get interrupted |
34 trap "cleanup_exit 255" TERM KILL INT QUIT ABRT |
33 trap "cleanup_exit" 0 # normal exit |
|
34 trap "exit 255" 1 2 3 6 15 # HUP INT QUIT ABRT TERM |
35 |
35 |
36 HGTMP="${TMPDIR-/tmp}/hgtests.$RANDOM.$RANDOM.$RANDOM.$$" |
36 HGTMP="${TMPDIR-/tmp}/hgtests.$RANDOM.$RANDOM.$RANDOM.$$" |
37 (umask 077 && mkdir "$HGTMP") || { |
37 (umask 077 && mkdir "$HGTMP") || { |
38 echo "Could not create temporary directory! Exiting." 1>&2 |
38 echo "Could not create temporary directory! Exiting." 1>&2 |
39 exit 1 |
39 exit 1 |
59 echo 'exec hg.real "$@"' |
59 echo 'exec hg.real "$@"' |
60 ) > "$INST/bin/hg" |
60 ) > "$INST/bin/hg" |
61 chmod 755 "$INST/bin/hg" |
61 chmod 755 "$INST/bin/hg" |
62 else |
62 else |
63 cat tests/install.err |
63 cat tests/install.err |
64 cleanup_exit 1 |
64 exit 1 |
65 fi |
65 fi |
66 cd "$TESTDIR" |
66 cd "$TESTDIR" |
67 |
67 |
68 PATH="$INST/bin:$PATH"; export PATH |
68 PATH="$INST/bin:$PATH"; export PATH |
69 PYTHONPATH="$INST/$lib/python"; export PYTHONPATH |
69 PYTHONPATH="$INST/$lib/python"; export PYTHONPATH |
124 |
124 |
125 echo |
125 echo |
126 echo "Ran $tests tests, $failed failed." |
126 echo "Ran $tests tests, $failed failed." |
127 |
127 |
128 if [ $failed -gt 0 ] ; then |
128 if [ $failed -gt 0 ] ; then |
129 cleanup_exit 1 |
129 exit 1 |
130 fi |
130 fi |
131 cleanup_exit 0 |
131 exit 0 |