bpo-30673: test.bat: add -t option (timeout) (#2211) · python/cpython@258bfc4 (original) (raw)

Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
1 1 @echo off
2 -rem Used by the buildbot "test" step.
2 +rem Script to run the Python test suite used by the "test" step
3 +rem of Windows buildbot slaves.
4 +rem
5 +rem See PCbuild/rt.bat for options, extra options:
6 +rem -t TIMEOUT: set a timeout in seconds
7 +
3 8 setlocal
4 9
5 10 set here=%~dp0
6 11 set rt_opts=-q -d
7 12 set regrtest_args=-j1
8 13
14 +rem Use a timeout of 20 minutes per test file by default
15 +set timeout=1200
16 +
9 17 :CheckOpts
10 18 if "%1"=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
11 19 if "%1"=="-d" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
12 20 if "%1"=="-O" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
13 21 if "%1"=="-q" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
14 22 if "%1"=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
15 23 if "%1"=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
24 +if "%1"=="-t" (set timeout=%2) & shift & shift & goto CheckOpts
16 25 if NOT "%1"=="" (set regrtest_args=%regrtest_args% %1) & shift & goto CheckOpts
17 26
18 27 echo on
19 -call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW --slowest --timeout=1200 %regrtest_args%
28 +call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW --slowest --timeout=%timeout% %regrtest_args%