comparison tests/run-tests @ 836:1fe3b14c7044

Merge with TAH
author mpm@selenic.com
date Thu, 04 Aug 2005 13:27:41 -0800
parents 0902ffece4b4 9de3535caae8
children 9c918287d10b
comparison
equal deleted inserted replaced
827:a61728b58dc0 836:1fe3b14c7044
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
95 fail=1 95 fail=1
96 elif [ -r "$OUTOK" ]; then 96 elif [ -r "$OUTOK" ]; then
97 if diff -u "$OUTOK" "$OUT" > /dev/null; then 97 if diff -u "$OUTOK" "$OUT" > /dev/null; then
98 : no differences 98 : no differences
99 else 99 else
100 if FIXME="`grep 'FIXME' \"$TESTDIR/$1\"`"; then 100 cp "$OUT" "$ERR"
101 echo 101 echo
102 echo "$1 failed, but this is ignored because of:" 102 echo "$1 output changed:"
103 echo "$FIXME" 103 diff -u "$OUTOK" "$ERR" || true
104 else 104 fail=1
105 cp "$OUT" "$ERR"
106 echo
107 echo "$1 output changed:"
108 diff -u "$OUTOK" "$ERR" || true
109 fail=1
110 fi
111 fi 105 fi
112 fi 106 fi
113 107
114 cd "$TESTDIR" 108 cd "$TESTDIR"
115 rm -f "$HGTMP/$1.out" 109 rm -f "$HGTMP/$1.out"
130 124
131 echo 125 echo
132 echo "Ran $tests tests, $failed failed." 126 echo "Ran $tests tests, $failed failed."
133 127
134 if [ $failed -gt 0 ] ; then 128 if [ $failed -gt 0 ] ; then
135 cleanup_exit 1 129 exit 1
136 fi 130 fi
137 cleanup_exit 0 131 exit 0