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

Skip to content

Commit 6f3bdc9

Browse files
committed
Issue #21907: Partially revert changes to Windows buildbot scripts.
Trying to use run_tests.py for testing is more trouble than it's worth; reverted to rt.bat. Also cleaned up rt.bat a bit. Trying to use hg purge to clean up after testing is also error-prone, so we're back to using the build solution's Clean targets.
1 parent 2fb369c commit 6f3bdc9

5 files changed

Lines changed: 27 additions & 27 deletions

File tree

PCbuild/rt.bat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ rem -q runs the tests just once, and without deleting .py[co] files.
99
rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
1010
rem from the 'amd64' dir instead of the 32-bit build in this dir.
1111
rem All leading instances of these switches are shifted off, and
12-
rem whatever remains is passed to regrtest.py. For example,
12+
rem whatever remains (up to 9 arguments) is passed to regrtest.py.
13+
rem For example,
1314
rem rt -O -d -x test_thread
1415
rem runs
1516
rem python_d -O ../lib/test/regrtest.py -x test_thread
@@ -26,25 +27,24 @@ rem rt -u "network,largefile"
2627

2728
setlocal
2829

29-
set prefix=.\
30+
set pcbuild=%~dp0
31+
set prefix=%pcbuild%
3032
set suffix=
3133
set qmode=
3234
set dashO=
33-
set tcltk=tcltk
3435

3536
:CheckOpts
3637
if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
3738
if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
3839
if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
39-
if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts
40+
if "%1"=="-x64" (set prefix=%pcbuild%amd64\) & shift & goto CheckOpts
4041

41-
PATH %PATH%;%~dp0..\..\%tcltk%\bin
42-
set exe=%prefix%\python%suffix%
43-
set cmd=%exe% %dashO% -Wd -E -bb ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
42+
set exe=%prefix%python%suffix%.exe
43+
set cmd="%exe%" %dashO% -Wd -E -bb "%pcbuild%..\lib\test\regrtest.py" %1 %2 %3 %4 %5 %6 %7 %8 %9
4444
if defined qmode goto Qmode
4545

4646
echo Deleting .pyc/.pyo files ...
47-
%exe% rmpyc.py
47+
"%exe%" "%pcbuild%rmpyc.py"
4848

4949
echo on
5050
%cmd%

Tools/buildbot/clean-amd64.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@rem Used by the buildbot "clean" step.
2-
call "%~dp0clean.bat"
2+
@call "%~dp0clean.bat" x64

Tools/buildbot/clean.bat

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ for %%k in (kill_python.exe
1616
"%pcbuild%\%%k"
1717
)
1818
)
19+
if "%1" == "x64" (
20+
set vcvars_target=x86_amd64
21+
set platform_target=x64
22+
) else (
23+
set vcvars_target=x86
24+
set platform_target=x86
25+
)
26+
call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" %vcvars_target%
27+
echo Deleting .pyc/.pyo files ...
28+
del /s "%root%\Lib\*.pyc" "%root%\Lib\*.pyo"
29+
echo Deleting test leftovers ...
30+
rmdir /s /q "%root%\build"
1931

20-
echo Purging all non-tracked files with `hg purge`
21-
echo on
22-
hg -R "%root%" --config extensions.purge= purge --all -X "%root%\Lib\test\data"
23-
24-
@rem Clean is best effort, so we "always succeed"
25-
@exit /b 0
32+
msbuild /target:clean "%pcbuild%\pcbuild.sln" /p:Configuration=Release /p:PlatformTarget=%platform_target%
33+
msbuild /target:clean "%pcbuild%\pcbuild.sln" /p:Configuration=Debug /p:PlatformTarget=%platform_target%

Tools/buildbot/test-amd64.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@rem Used by the buildbot "test" step.
22

3+
setlocal
34
rem The following line should be removed before #20035 is closed
45
set TCL_LIBRARY=%~dp0..\..\..\tcltk64\lib\tcl8.6
56

6-
"%~dp0..\..\PCbuild\amd64\python_d.exe" "%~dp0..\scripts\run_tests.py" -j 1 -u all -W --timeout=3600 %*
7+
call "%~dp0..\..\PCbuild\rt.bat" -d -q -x64 -uall -rwW -n --timeout=3600 %*

Tools/buildbot/test.bat

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
@rem Used by the buildbot "test" step.
22

3+
setlocal
34
rem The following line should be removed before #20035 is closed
45
set TCL_LIBRARY=%~dp0..\..\..\tcltk\lib\tcl8.6
56

6-
ver | findstr "Version 6." >nul
7-
if %ERRORLEVEL% == 1 goto xp
8-
9-
"%~dp0..\..\PCbuild\python_d.exe" "%~dp0..\scripts\run_tests.py" -j 1 -u all -W --timeout=3600 %*
10-
goto done
11-
12-
:xp
13-
cd PCbuild
14-
call rt.bat -d -q -uall -rwW -n --timeout=3600 %1 %2 %3 %4 %5 %6 %7 %8 %9
15-
16-
:done
7+
call "%~dp0..\..\PCbuild\rt.bat" -d -q -uall -rwW -n --timeout=3600 %*

0 commit comments

Comments
 (0)