cpython/runtests.sh

69 lines
1.3 KiB
Bash
Raw Normal View History

2007-05-23 14:28:08 -03:00
#!/bin/sh
# A script that runs each unit test independently, with output
# directed to a file in OUT/$T.out. If command line arguments are
# given, they are tests to run; otherwise every file named
# Lib/test/test_* is run (via regrtest). A summary of failing,
# passing and skipped tests is written to stdout and to the files
# GOOD, BAD and SKIPPED.
# Reset PYTHONPATH to avoid alien influences on the tests.
unset PYTHONPATH
# Choose the Python binary.
case `uname` in
Darwin) PYTHON=./python.exe;;
2007-07-18 13:59:11 -03:00
CYGWIN*) PYTHON=./python.exe;;
2007-05-23 14:28:08 -03:00
*) PYTHON=./python;;
esac
# Create the output directory if necessary.
mkdir -p OUT
# Empty the summary files.
>GOOD
>BAD
>SKIPPED
# The -u flag.
Merged revisions 56020-56124 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/p3yk ................ r56037 | georg.brandl | 2007-06-19 05:33:20 -0700 (Tue, 19 Jun 2007) | 2 lines Patch #1739659: don't slice dict.keys() in pydoc. ................ r56060 | martin.v.loewis | 2007-06-21 13:00:02 -0700 (Thu, 21 Jun 2007) | 2 lines Regenerate to add True, False, None. ................ r56069 | neal.norwitz | 2007-06-21 22:31:56 -0700 (Thu, 21 Jun 2007) | 1 line Get the doctest working again after adding None, True, and False as kewyords. ................ r56070 | neal.norwitz | 2007-06-21 23:25:33 -0700 (Thu, 21 Jun 2007) | 1 line Add space to error message. ................ r56071 | neal.norwitz | 2007-06-21 23:40:04 -0700 (Thu, 21 Jun 2007) | 6 lines Get pybench working, primarily * Use print function * Stop using string module * Use sorted instead of assuming dict methods return lists * Convert range result to a list ................ r56089 | collin.winter | 2007-06-26 10:31:48 -0700 (Tue, 26 Jun 2007) | 1 line Fix AttributeError in distutils/dir_util.py. ................ r56124 | guido.van.rossum | 2007-06-29 18:04:31 -0700 (Fri, 29 Jun 2007) | 30 lines Merged revisions 56014-56123 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r56019 | lars.gustaebel | 2007-06-18 04:42:11 -0700 (Mon, 18 Jun 2007) | 2 lines Added exclude keyword argument to the TarFile.add() method. ........ r56023 | lars.gustaebel | 2007-06-18 13:05:55 -0700 (Mon, 18 Jun 2007) | 3 lines Added missing \versionchanged tag for the new exclude parameter. ........ r56038 | georg.brandl | 2007-06-19 05:36:00 -0700 (Tue, 19 Jun 2007) | 2 lines Bug #1737864: allow empty message in logging format routines. ........ r56040 | georg.brandl | 2007-06-19 05:38:20 -0700 (Tue, 19 Jun 2007) | 2 lines Bug #1739115: make shutil.rmtree docs clear wrt. file deletion. ........ r56084 | georg.brandl | 2007-06-25 08:21:23 -0700 (Mon, 25 Jun 2007) | 2 lines Bug #1742901: document None behavior of shlex.split. ........ r56091 | georg.brandl | 2007-06-27 07:09:56 -0700 (Wed, 27 Jun 2007) | 2 lines Fix a variable name in winreg docs. ........ ................
2007-06-30 02:01:58 -03:00
UFLAG=""
case $1 in
-u)
UFLAG="$1 $2"; shift; shift;;
-u*)
UFLAG="$1"; shift;;
esac
2007-05-23 14:28:08 -03:00
# Compute the list of tests to run.
case $# in
0)
TESTS=`(cd Lib/test; ls test_*.py | sed 's/\.py//')`
2007-05-23 14:28:08 -03:00
;;
*)
TESTS="$@"
;;
esac
# Run the tests.
for T in $TESTS
do
echo -n $T
if case $T in
*curses*) echo; $PYTHON Lib/test/regrtest.py $UFLAG $T 2>OUT/$T.out;;
*) $PYTHON Lib/test/regrtest.py $UFLAG $T >OUT/$T.out 2>&1;;
esac
2007-05-23 14:28:08 -03:00
then
if grep -q "1 test skipped:" OUT/$T.out
then
echo " SKIPPED"
echo $T >>SKIPPED
else
echo
echo $T >>GOOD
fi
else
echo " BAD"
echo $T >>BAD
fi
done