• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@echo off
2rem Used by the buildbot "test" step.
3setlocal
4
5set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH
6set here=%~dp0
7set rt_opts=-q -d
8set regrtest_args=
9set arm32_ssh=
10set cmdline_args=%*
11set cmdline_args=%cmdline_args:,=#COMMA#%
12
13call:CheckOpts %cmdline_args%
14
15if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecution
16if "%arm32_ssh%"=="true" goto :Arm32Ssh
17
18:NativeExecution
19call "%here%..\..\PCbuild\rt.bat" %rt_opts% --slow-ci %regrtest_args%
20exit /b %ERRORLEVEL%
21
22:Arm32Ssh
23set dashU=-unetwork -udecimal -usubprocess -uurlfetch -utzdata
24if "%SSH_SERVER%"=="" goto :Arm32SshHelp
25if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\)
26if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
27if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
28
29set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp
30
31set rt_args=%rt_opts% --slow-ci %dashU% %regrtest_args% %TEMP_ARGS%
32ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& cd %REMOTE_PYTHON_DIR% & %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args%
33set ERR=%ERRORLEVEL%
34scp %SSH_SERVER%:"%REMOTE_PYTHON_DIR%test-results.xml" "%PYTHON_SOURCE%\test-results.xml"
35exit /b %ERR%
36
37:Arm32SshHelp
38echo SSH_SERVER environment variable must be set to administrator@[ip address]
39echo where [ip address] is the address of a Windows IoT Core ARM32 device.
40echo.
41echo The test worker should have the SSH agent running.
42echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine
43echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh
44exit /b 127
45
46:CheckOpts
47set arg="%~1"
48if %arg%=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
49if %arg%=="-arm64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
50if %arg%=="-arm32" (set rt_opts=%rt_opts% %1) & (set arm32_ssh=true) & shift & goto CheckOpts
51if %arg%=="-d" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
52if %arg%=="-O" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
53if %arg%=="-q" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
54if %arg%=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
55if %arg%=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
56if NOT %arg%=="" (set regrtest_args=%regrtest_args% %arg:#COMMA#=,%) & shift & goto CheckOpts
57goto:eof
58