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

Skip to content

gh-115556: Remove quotes from command-line arguments in test.bat and rt.bat #115557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
On Windows, commas passed in arguments to ``Tools\buildbot\test.bat`` and
``PCbuild\\rt.bat`` are now properly handled.
22 changes: 11 additions & 11 deletions PCbuild/rt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ set regrtestargs=--fast-ci
set exe=

:CheckOpts
if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
if "%~1"=="-O" (set dashO=-O) & shift & goto CheckOpts
if "%~1"=="-q" (set qmode=yes) & shift & goto CheckOpts
if "%~1"=="-d" (set suffix=_d) & shift & goto CheckOpts
rem HACK: Need some way to infer the version number in this script
if "%1"=="--disable-gil" (set pyname=python3.13t) & shift & goto CheckOpts
if "%1"=="-win32" (set prefix=%pcbuild%win32) & shift & goto CheckOpts
if "%1"=="-x64" (set prefix=%pcbuild%amd64) & shift & goto CheckOpts
if "%1"=="-amd64" (set prefix=%pcbuild%amd64) & shift & goto CheckOpts
if "%1"=="-arm64" (set prefix=%pcbuild%arm64) & shift & goto CheckOpts
if "%1"=="-arm32" (set prefix=%pcbuild%arm32) & shift & goto CheckOpts
if "%1"=="-p" (call :SetPlatform %~2) & shift & shift & goto CheckOpts
if NOT "%1"=="" (set regrtestargs=%regrtestargs% %1) & shift & goto CheckOpts
if "%~1"=="--disable-gil" (set pyname=python3.13t) & shift & goto CheckOpts
if "%~1"=="-win32" (set prefix=%pcbuild%win32) & shift & goto CheckOpts
if "%~1"=="-x64" (set prefix=%pcbuild%amd64) & shift & goto CheckOpts
if "%~1"=="-amd64" (set prefix=%pcbuild%amd64) & shift & goto CheckOpts
if "%~1"=="-arm64" (set prefix=%pcbuild%arm64) & shift & goto CheckOpts
if "%~1"=="-arm32" (set prefix=%pcbuild%arm32) & shift & goto CheckOpts
if "%~1"=="-p" (call :SetPlatform %~2) & shift & shift & goto CheckOpts
if NOT "%~1"=="" (set regrtestargs=%regrtestargs% %~1) & shift & goto CheckOpts

if not defined prefix set prefix=%pcbuild%amd64
set exe=%prefix%\%pyname%%suffix%.exe
Expand Down
26 changes: 16 additions & 10 deletions Tools/buildbot/test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@ set here=%~dp0
set rt_opts=-q -d
set regrtest_args=
set arm32_ssh=
set cmdline_args=%*
set cmdline_args=%cmdline_args:,=#COMMA#%

:CheckOpts
if "%1"=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if "%1"=="-arm64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if "%1"=="-arm32" (set rt_opts=%rt_opts% %1) & (set arm32_ssh=true) & shift & goto CheckOpts
if "%1"=="-d" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if "%1"=="-O" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if "%1"=="-q" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if "%1"=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
if "%1"=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
if NOT "%1"=="" (set regrtest_args=%regrtest_args% %1) & shift & goto CheckOpts
call:CheckOpts %cmdline_args%

if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecution
if "%arm32_ssh%"=="true" goto :Arm32Ssh
Expand Down Expand Up @@ -49,3 +42,16 @@ echo The test worker should have the SSH agent running.
echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine
echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh
exit /b 127

:CheckOpts
set arg="%~1"
if %arg%=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if %arg%=="-arm64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if %arg%=="-arm32" (set rt_opts=%rt_opts% %1) & (set arm32_ssh=true) & shift & goto CheckOpts
if %arg%=="-d" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if %arg%=="-O" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if %arg%=="-q" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
if %arg%=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
if %arg%=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
if NOT %arg%=="" (set regrtest_args=%regrtest_args% %arg:#COMMA#=,%) & shift & goto CheckOpts
goto:eof