tests/run-tests
changeset 803 3d47e7fc33a3
parent 802 69db1e34378b
child 804 19388dcbac49
equal deleted inserted replaced
802:69db1e34378b 803:3d47e7fc33a3
    58 if ${PYTHON:-python} setup.py install --home="$INST" > tests/install.err 2>&1
    58 if ${PYTHON:-python} setup.py install --home="$INST" > tests/install.err 2>&1
    59 then
    59 then
    60     rm tests/install.err
    60     rm tests/install.err
    61     mv "$INST/bin/hg" "$INST/bin/hg.real"
    61     mv "$INST/bin/hg" "$INST/bin/hg.real"
    62     (
    62     (
    63         echo '#!/bin/sh'
    63 	echo '#!/bin/sh'
    64         echo 'echo "+ hg $@"'
    64 	echo 'echo "+ hg $@"'
    65         echo 'exec hg.real "$@"'
    65 	echo 'exec hg.real "$@"'
    66     ) > "$INST/bin/hg"
    66     ) > "$INST/bin/hg"
    67     chmod 755 "$INST/bin/hg"
    67     chmod 755 "$INST/bin/hg"
    68 else
    68 else
    69     cat tests/install.err
    69     cat tests/install.err
    70     cleanup_exit 1
    70     cleanup_exit 1
    85     OUT="$HGTMP/$1.out"
    85     OUT="$HGTMP/$1.out"
    86     OUTOK="$TESTDIR/$1.out"
    86     OUTOK="$TESTDIR/$1.out"
    87     ERR="$TESTDIR/$1.err"
    87     ERR="$TESTDIR/$1.err"
    88 
    88 
    89     if "$TESTDIR/$1" > "$OUT" 2>&1; then
    89     if "$TESTDIR/$1" > "$OUT" 2>&1; then
    90         : no error
    90 	: no error
    91     else
    91     else
    92 	echo "$1 failed with error code $?"
    92 	echo "$1 failed with error code $?"
    93 	fail=1
    93 	fail=1
    94     fi
    94     fi
    95 
    95 
    98 	echo
    98 	echo
    99 	echo "$1 generated unexpected output:"
    99 	echo "$1 generated unexpected output:"
   100 	cat "$ERR"
   100 	cat "$ERR"
   101 	fail=1
   101 	fail=1
   102     elif [ -r "$OUTOK" ]; then
   102     elif [ -r "$OUTOK" ]; then
   103         if diff -u "$OUTOK" "$OUT" > /dev/null; then
   103 	if diff -u "$OUTOK" "$OUT" > /dev/null; then
   104             : no differences
   104 	    : no differences
   105         else
   105 	else
   106             if FIXME="`grep 'FIXME' \"$TESTDIR/$1\"`"; then
   106 	    if FIXME="`grep 'FIXME' \"$TESTDIR/$1\"`"; then
   107                 echo
   107 		echo
   108                 echo "$1 failed, but this is ignored because of:"
   108 		echo "$1 failed, but this is ignored because of:"
   109                 echo "$FIXME"
   109 		echo "$FIXME"
   110             else
   110 	    else
   111                 cp "$OUT" "$ERR"
   111 		cp "$OUT" "$ERR"
   112                 echo
   112 		echo
   113                 echo "$1 output changed:"
   113 		echo "$1 output changed:"
   114                 diff -u "$OUTOK" "$ERR" || true
   114 		diff -u "$OUTOK" "$ERR" || true
   115                 fail=1
   115 		fail=1
   116             fi
   116 	    fi
   117         fi
   117 	fi
   118     fi
   118     fi
   119 
   119 
   120     cd "$TESTDIR"
   120     cd "$TESTDIR"
   121     rm -f "$HGTMP/$1.out"
   121     rm -f "$HGTMP/$1.out"
   122     rm -rf "$HGTMP/$1"
   122     rm -rf "$HGTMP/$1"