blob: 7129e203491fbf8f92d875463b7b40730f83b7da [file] [log] [blame]
Tim Peters42cd14d2004-08-30 22:13:22 +00001@echo off
2rem Run Tests. Run the regression test suite.
Christian Heimesdd15f6c2008-03-16 00:07:10 +00003rem Usage: rt [-d] [-O] [-q] [-x64] regrtest_args
Tim Peters42cd14d2004-08-30 22:13:22 +00004rem -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.
Christian Heimesdd15f6c2008-03-16 00:07:10 +00009rem -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.
Tim Peters42cd14d2004-08-30 22:13:22 +000011rem 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
Christian Heimesdd15f6c2008-03-16 00:07:10 +000029set prefix=.\
30set suffix=
Tim Peters42cd14d2004-08-30 22:13:22 +000031set qmode=
32set dashO=
Hirokazu Yamamotofc2e1d12010-09-17 08:53:31 +000033set tcltk=tcltk
Tim Peters42cd14d2004-08-30 22:13:22 +000034
Tim Peters755f4c12001-01-23 02:42:09 +000035:CheckOpts
Tim Peters42cd14d2004-08-30 22:13:22 +000036if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
37if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
Christian Heimesdd15f6c2008-03-16 00:07:10 +000038if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
39if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
Tim Peters42cd14d2004-08-30 22:13:22 +000040
Hirokazu Yamamoto90387ff2010-09-18 00:31:44 +000041PATH %PATH%;%~dp0..\..\%tcltk%\bin
Christian Heimesdd15f6c2008-03-16 00:07:10 +000042set exe=%prefix%\python%suffix%
Ezio Melottib46dfb02010-04-03 15:27:05 +000043set cmd=%exe% %dashO% -Wd -E -bb ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
Tim Peters42cd14d2004-08-30 22:13:22 +000044if defined qmode goto Qmode
45
46echo Deleting .pyc/.pyo files ...
47%exe% rmpyc.py
48
49echo on
50%cmd%
51@echo off
52
53echo About to run again without deleting .pyc/.pyo first:
54pause
55
Tim Peters2ad1a442001-01-20 01:53:43 +000056:Qmode
Tim Peters42cd14d2004-08-30 22:13:22 +000057echo on
58%cmd%