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