Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cfa980

Browse files
committed
Run tests twice by default, first time deleting .pyc/.pyo files.
New option "-q" to leave .pyc/.pyo alone.
1 parent 6f77667 commit 2cfa980

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

PCbuild/rt.bat

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
@rem Run Tests. Run the regression test suite.
22
@rem Plain "rt" runs Release build, arguments passed on to regrtest.
33
@rem "rt -d" runs Debug build similarly, after shifting off -d.
4+
@rem Normally the tests are run twice, the first time after deleting
5+
@rem all the .py[co] files from Lib/ and Lib/test. But
6+
@rem "rt -q" (for Quick) runs the tests just once, and without
7+
@rem bothering to delete .py[co] files.
48
@set _exe=python
5-
@if "%1" =="-d" set _exe=python_d
6-
@if "%1" =="-d" shift
9+
@set _qmode=no
10+
@if "%1"=="-q" set _qmode=yes
11+
@if "%1"=="-q" shift
12+
@if "%1"=="-d" set _exe=python_d
13+
@if "%1"=="-d" shift
14+
@if "%_qmode%"=="yes" goto LeavePyc
15+
@if "%1"=="-q" set _qmode=yes
16+
@if "%1"=="-q" shift
17+
@if "%_qmode%"=="yes" goto LeavePyc
18+
@echo Deleting .pyc/.pyo files ...
719
@del ..\Lib\*.pyc
820
@del ..\Lib\*.pyo
921
@del ..\Lib\test\*.pyc
1022
@del ..\Lib\test\*.pyo
23+
:LeavePyc
1124
%_exe% ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
25+
@if "%_qmode%"=="yes" goto Done
26+
@echo Running again without deleting .pyc/.pyo first:
27+
%_exe% ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
28+
:Done
1229
@set _exe=
30+
@set _qmode=

0 commit comments

Comments
 (0)