Thomas Wouters | 477c8d5 | 2006-05-27 19:21:47 +0000 | [diff] [blame] | 1 | @echo off
|
| 2 | rem Run Tests. Run the regression test suite.
|
| 3 | rem Usage: rt [-d] [-O] [-q] regrtest_args
|
| 4 | rem -d Run Debug build (python_d.exe). Else release build.
|
Guido van Rossum | 360e4b8 | 2007-05-14 22:51:27 +0000 | [diff] [blame] | 5 | rem -pgo Run PGO build, e.g. for instrumentation
|
| 6 | rem -x64 Run the x64 version, otherwise win32
|
Thomas Wouters | 477c8d5 | 2006-05-27 19:21:47 +0000 | [diff] [blame] | 7 | rem -O Run python.exe or python_d.exe (see -d) with -O.
|
| 8 | rem -q "quick" -- normally the tests are run twice, the first time
|
| 9 | rem after deleting all the .py[co] files reachable from Lib/.
|
| 10 | rem -q runs the tests just once, and without deleting .py[co] files.
|
| 11 | rem All leading instances of these switches are shifted off, and
|
| 12 | rem whatever remains is passed to regrtest.py. For example,
|
| 13 | rem rt -O -d -x test_thread
|
| 14 | rem runs
|
| 15 | rem python_d -O ../lib/test/regrtest.py -x test_thread
|
| 16 | rem twice, and
|
| 17 | rem rt -q -g test_binascii
|
| 18 | rem runs
|
| 19 | rem python_d ../lib/test/regrtest.py -g test_binascii
|
| 20 | rem to generate the expected-output file for binascii quickly.
|
| 21 | rem
|
| 22 | rem Confusing: if you want to pass a comma-separated list, like
|
| 23 | rem -u network,largefile
|
| 24 | rem then you have to quote it on the rt line, like
|
| 25 | rem rt -u "network,largefile"
|
| 26 |
|
| 27 | setlocal
|
| 28 |
|
Guido van Rossum | 360e4b8 | 2007-05-14 22:51:27 +0000 | [diff] [blame] | 29 | set platf=win32
|
| 30 | set exe=python.exe
|
Thomas Wouters | 477c8d5 | 2006-05-27 19:21:47 +0000 | [diff] [blame] | 31 | set qmode=
|
| 32 | set dashO=
|
Guido van Rossum | 360e4b8 | 2007-05-14 22:51:27 +0000 | [diff] [blame] | 33 | set conf=Release
|
Thomas Wouters | 477c8d5 | 2006-05-27 19:21:47 +0000 | [diff] [blame] | 34 | PATH %PATH%;..\..\tcltk\bin
|
| 35 |
|
| 36 | :CheckOpts
|
| 37 | if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
|
| 38 | if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
|
Guido van Rossum | 360e4b8 | 2007-05-14 22:51:27 +0000 | [diff] [blame] | 39 | if "%1"=="-d" (set exe=python_d.exe) & (set conf=Debug) & shift & goto CheckOpts
|
| 40 | if "%1"=="-x64" (set platf=x64) & shift & goto CheckOpts
|
| 41 | if "%1"=="-pgo" (set conf=PGO) & shift & goto CheckOpts
|
Thomas Wouters | 477c8d5 | 2006-05-27 19:21:47 +0000 | [diff] [blame] | 42 |
|
Guido van Rossum | 360e4b8 | 2007-05-14 22:51:27 +0000 | [diff] [blame] | 43 | set exe=%platf%%conf%\%exe%
|
Thomas Wouters | 477c8d5 | 2006-05-27 19:21:47 +0000 | [diff] [blame] | 44 | set cmd=%exe% %dashO% -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
|
| 45 | if defined qmode goto Qmode
|
| 46 |
|
| 47 | echo Deleting .pyc/.pyo files ...
|
| 48 | %exe% rmpyc.py
|
| 49 |
|
| 50 | echo on
|
| 51 | %cmd%
|
| 52 | @echo off
|
| 53 |
|
| 54 | echo About to run again without deleting .pyc/.pyo first:
|
| 55 | pause
|
| 56 |
|
| 57 | :Qmode
|
| 58 | echo on
|
| 59 | %cmd%
|