Cleaned up trap handling in run-tests, too.
--- a/tests/run-tests
+++ b/tests/run-tests
@@ -27,11 +27,11 @@ failed=0
HGTMP=""
cleanup_exit() {
rm -rf "$HGTMP"
- exit $1
}
# Remove temporary files even if we get interrupted
-trap "cleanup_exit 255" TERM KILL INT QUIT ABRT
+trap "cleanup_exit" 0 # normal exit
+trap "exit 255" 1 2 3 6 15 # HUP INT QUIT ABRT TERM
HGTMP="${TMPDIR-/tmp}/hgtests.$RANDOM.$RANDOM.$RANDOM.$$"
(umask 077 && mkdir "$HGTMP") || {
@@ -61,7 +61,7 @@ then
chmod 755 "$INST/bin/hg"
else
cat tests/install.err
- cleanup_exit 1
+ exit 1
fi
cd "$TESTDIR"
@@ -126,6 +126,6 @@ echo
echo "Ran $tests tests, $failed failed."
if [ $failed -gt 0 ] ; then
- cleanup_exit 1
+ exit 1
fi
-cleanup_exit 0
+exit 0