blob: c90460e2fa560d14d51c863744fc6151c9fe2d3c [file] [log] [blame]
Guido van Rossume53309c2007-05-23 17:28:08 +00001#!/bin/sh
2
3# A script that runs each unit test independently, with output
4# directed to a file in OUT/$T.out. If command line arguments are
5# given, they are tests to run; otherwise every file named
6# Lib/test/test_* is run (via regrtest). A summary of failing,
7# passing and skipped tests is written to stdout and to the files
8# GOOD, BAD and SKIPPED.
9
10# Reset PYTHONPATH to avoid alien influences on the tests.
11unset PYTHONPATH
12
13# Choose the Python binary.
14case `uname` in
15Darwin) PYTHON=./python.exe;;
16*) PYTHON=./python;;
17esac
18
19# Create the output directory if necessary.
20mkdir -p OUT
21
22# Empty the summary files.
23>GOOD
24>BAD
25>SKIPPED
26
27# Compute the list of tests to run.
28case $# in
290)
Guido van Rossum2bf71382007-06-08 00:07:57 +000030 TESTS=`(cd Lib/test; ls test_*.py | sed 's/\.py//')`
Guido van Rossume53309c2007-05-23 17:28:08 +000031 ;;
32*)
33 TESTS="$@"
34 ;;
35esac
36
37# Run the tests.
38for T in $TESTS
39do
40 echo -n $T
41 if $PYTHON Lib/test/regrtest.py -uall $T >OUT/$T.out 2>&1
42 then
43 if grep -q "1 test skipped:" OUT/$T.out
44 then
45 echo " SKIPPED"
46 echo $T >>SKIPPED
47 else
48 echo
49 echo $T >>GOOD
50 fi
51 else
52 echo " BAD"
53 echo $T >>BAD
54 fi
55done