blob: 583d4f3339f9ce3d289e682890b7905a067b1d6f [file] [log] [blame]
Christian Heimese8954f82007-11-22 11:21:16 +00001@echo off
2rem Run Tests. Run the regression test suite.
Martin v. Löwisbf7b0b72008-03-14 13:56:09 +00003rem Usage: rt [-d] [-O] [-q] [-x64] regrtest_args
Christian Heimese8954f82007-11-22 11:21:16 +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.
Martin v. Löwisbf7b0b72008-03-14 13:56:09 +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.
Christian Heimese8954f82007-11-22 11:21:16 +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
Martin v. Löwisbf7b0b72008-03-14 13:56:09 +000029set prefix=.\
30set suffix=
Christian Heimese8954f82007-11-22 11:21:16 +000031set qmode=
32set dashO=
Martin v. Löwisbf7b0b72008-03-14 13:56:09 +000033set tcltk=
Christian Heimese8954f82007-11-22 11:21:16 +000034
35:CheckOpts
36if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
37if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
Martin v. Löwisbf7b0b72008-03-14 13:56:09 +000038if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
39if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
Christian Heimese8954f82007-11-22 11:21:16 +000040
Martin v. Löwisbf7b0b72008-03-14 13:56:09 +000041PATH %PATH%;..\..\%tcltk%\bin
42set exe=%prefix%\python%suffix%
Christian Heimese8954f82007-11-22 11:21:16 +000043set cmd=%exe% %dashO% -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
44if 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
56:Qmode
57echo on
58%cmd%