blob: 13c9d629398f57460bb6adf5362734b8eb5adf91 [file] [log] [blame]
Zachary Ware4c9c8482015-04-13 11:59:54 -05001@echo off
2rem Run Tests. Run the regression test suite.
3rem Usage: rt [-d] [-O] [-q] [-x64] regrtest_args
4rem -d Run Debug build (python_d.exe). Else release build.
5rem -O Run python.exe or python_d.exe (see -d) with -O.
6rem -q "quick" -- normally the tests are run twice, the first time
7rem after deleting all the .py[co] files reachable from Lib/.
8rem -q runs the tests just once, and without deleting .py[co] files.
9rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
10rem from the 'amd64' dir instead of the 32-bit build in this dir.
11rem All leading instances of these switches are shifted off, and
Zachary Ware6250df82015-06-09 23:16:52 -050012rem whatever remains (up to 9 arguments) is passed to regrtest.py.
13rem For example,
Zachary Ware4c9c8482015-04-13 11:59:54 -050014rem rt -O -d -x test_thread
15rem runs
16rem python_d -O ../lib/test/regrtest.py -x test_thread
17rem twice, and
18rem rt -q -g test_binascii
19rem runs
20rem python_d ../lib/test/regrtest.py -g test_binascii
21rem to generate the expected-output file for binascii quickly.
22rem
23rem Confusing: if you want to pass a comma-separated list, like
24rem -u network,largefile
25rem then you have to quote it on the rt line, like
26rem rt -u "network,largefile"
27
28setlocal
29
Zachary Ware6250df82015-06-09 23:16:52 -050030set pcbuild=%~dp0
31set prefix=%pcbuild%
Zachary Ware4c9c8482015-04-13 11:59:54 -050032set suffix=
33set qmode=
34set dashO=
35set tcltk=tcltk
36
37:CheckOpts
38if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
39if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
40if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
Zachary Ware6250df82015-06-09 23:16:52 -050041if "%1"=="-x64" (set prefix=%prefix%amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
Zachary Ware4c9c8482015-04-13 11:59:54 -050042
Zachary Ware6250df82015-06-09 23:16:52 -050043PATH %PATH%;%pcbuild%..\externals\%tcltk%\bin
44set exe="%prefix%\python%suffix%"
45set cmd=%exe% %dashO% -Wd -E -bb "%pcbuild%..\lib\test\regrtest.py" %1 %2 %3 %4 %5 %6 %7 %8 %9
Zachary Ware4c9c8482015-04-13 11:59:54 -050046if defined qmode goto Qmode
47
48echo Deleting .pyc/.pyo files ...
Zachary Ware6250df82015-06-09 23:16:52 -050049%exe% "%pcbuild%\rmpyc.py"
Zachary Ware4c9c8482015-04-13 11:59:54 -050050
51echo on
52%cmd%
53@echo off
54
55echo About to run again without deleting .pyc/.pyo first:
56pause
57
58:Qmode
59echo on
60%cmd%