Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 1 | @echo off
|
| 2 | rem Run Tests. Run the regression test suite.
|
| 3 | rem Usage: rt [-d] [-O] [-q] [-x64] regrtest_args
|
| 4 | rem -d Run Debug build (python_d.exe). Else release build.
|
| 5 | rem -O Run python.exe or python_d.exe (see -d) with -O.
|
| 6 | rem -q "quick" -- normally the tests are run twice, the first time
|
| 7 | rem after deleting all the .py[co] files reachable from Lib/.
|
| 8 | rem -q runs the tests just once, and without deleting .py[co] files.
|
| 9 | rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
|
| 10 | rem from the 'amd64' dir instead of the 32-bit build in this dir.
|
| 11 | rem All leading instances of these switches are shifted off, and
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 12 | rem whatever remains (up to 9 arguments) is passed to regrtest.py.
|
| 13 | rem For example,
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 14 | rem rt -O -d -x test_thread
|
| 15 | rem runs
|
| 16 | rem python_d -O ../lib/test/regrtest.py -x test_thread
|
| 17 | rem twice, and
|
| 18 | rem rt -q -g test_binascii
|
| 19 | rem runs
|
| 20 | rem python_d ../lib/test/regrtest.py -g test_binascii
|
| 21 | rem to generate the expected-output file for binascii quickly.
|
| 22 | rem
|
| 23 | rem Confusing: if you want to pass a comma-separated list, like
|
| 24 | rem -u network,largefile
|
| 25 | rem then you have to quote it on the rt line, like
|
| 26 | rem rt -u "network,largefile"
|
| 27 |
|
| 28 | setlocal
|
| 29 |
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 30 | set pcbuild=%~dp0
|
| 31 | set prefix=%pcbuild%win32\
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 32 | set suffix=
|
| 33 | set qmode=
|
| 34 | set dashO=
|
Zachary Ware | e74fe18 | 2015-09-03 23:43:37 -0500 | [diff] [blame] | 35 | set regrtestargs=
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 36 |
|
| 37 | :CheckOpts
|
| 38 | if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
|
| 39 | if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
|
| 40 | if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 41 | if "%1"=="-x64" (set prefix=%pcbuild%amd64\) & shift & goto CheckOpts
|
Zachary Ware | e74fe18 | 2015-09-03 23:43:37 -0500 | [diff] [blame] | 42 | if NOT "%1"=="" (set regrtestargs=%regrtestargs% %1) & shift & goto CheckOpts
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 43 |
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 44 | set exe=%prefix%python%suffix%.exe
|
Victor Stinner | 8c08e0d | 2016-03-24 17:46:24 +0100 | [diff] [blame] | 45 | set cmd="%exe%" %dashO% -Wd -E -bb -m test %regrtestargs%
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 46 | if defined qmode goto Qmode
|
| 47 |
|
| 48 | echo Deleting .pyc/.pyo files ...
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 49 | "%exe%" "%pcbuild%rmpyc.py"
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 50 |
|
| 51 | echo on
|
| 52 | %cmd%
|
| 53 | @echo off
|
| 54 |
|
| 55 | echo About to run again without deleting .pyc/.pyo first:
|
| 56 | pause
|
| 57 |
|
| 58 | :Qmode
|
| 59 | echo on
|
| 60 | %cmd%
|