3 HELP
="Usage: ./runtests.py [-h] [-x] [flags] [tests]
5 Runs each unit test independently, with output directed to a file in
6 OUT/<test>.out. If no tests are given, all tests are run; otherwise,
7 only the specified tests are run, unless -x is also given, in which
8 case all tests *except* those given are run.
10 Standard output shows the name of the tests run, with 'BAD' or
11 'SKIPPED' added if the test didn't produce a positive result. Also,
12 three files are created, named 'BAD', 'GOOD' and 'SKIPPED', to which
13 are written the names of the tests categorized by result.
15 Flags (arguments starting with '-') are passed transparently to
16 regrtest.py, except for -x, which is processed here."
18 # Choose the Python binary.
20 Darwin
) PYTHON
=.
/python.exe
;;
21 CYGWIN
*) PYTHON
=.
/python.exe
;;
27 # Unset PYTHONPATH, just to be sure.
30 # Create the output directory if necessary.
33 # Empty the summary files.
38 # Process flags (transparently pass these on to regrtest.py)
44 -h|
--h|
-help|
--help) echo "$HELP"; exit;;
45 --) FLAGS
="$FLAGS $1"; shift; break;;
46 -x) EXCEPT
="$1"; shift;;
47 -*) FLAGS
="$FLAGS $1"; shift;;
52 # Compute the list of tests to run.
55 TESTS
=`(cd Lib/test; ls test_*.py | sed 's/\.py//')`
58 PAT
="^(`echo $@ | sed 's/\.py//g' | sed 's/ /|/g'`)$"
59 TESTS
=`(cd Lib/test; ls test_*.py | sed 's/\.py//' | egrep -v "$PAT")`
73 $PYTHON -E Lib
/test
/regrtest.py
$FLAGS $T 2>OUT
/$T.out
75 *) $PYTHON -E Lib
/test
/regrtest.py
$FLAGS $T >OUT
/$T.out
2>&1;;
78 if grep -q "1 test skipped:" OUT
/$T.out
93 wc -l BAD GOOD SKIPPED