Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 1 | @echo off |
| 2 | rem Run Tests. Run the regression test suite. |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 3 | rem Usage: rt [-d] [-O] [-q] [-x64] regrtest_args |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 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. |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 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. |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 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 | |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 29 | set prefix=.\ |
| 30 | set suffix= |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 31 | set qmode= |
| 32 | set dashO= |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 33 | set tcltk= |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 34 | |
Tim Peters | 755f4c1 | 2001-01-23 02:42:09 +0000 | [diff] [blame] | 35 | :CheckOpts |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 36 | if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts |
| 37 | if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 38 | if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts |
| 39 | if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 40 | |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 41 | PATH %PATH%;..\..\%tcltk%\bin |
| 42 | set exe=%prefix%\python%suffix% |
Georg Brandl | e1b5ac6 | 2008-06-04 13:06:58 +0000 | [diff] [blame] | 43 | set cmd=%exe% %dashO% -E ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9 |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 44 | if defined qmode goto Qmode |
| 45 | |
| 46 | echo Deleting .pyc/.pyo files ... |
| 47 | %exe% rmpyc.py |
| 48 | |
| 49 | echo on |
| 50 | %cmd% |
| 51 | @echo off |
| 52 | |
| 53 | echo About to run again without deleting .pyc/.pyo first: |
| 54 | pause |
| 55 | |
Tim Peters | 2ad1a44 | 2001-01-20 01:53:43 +0000 | [diff] [blame] | 56 | :Qmode |
Tim Peters | 42cd14d | 2004-08-30 22:13:22 +0000 | [diff] [blame] | 57 | echo on |
| 58 | %cmd% |