From 491ffc337a9f5688caccc18cc489bce8056858b6 Mon Sep 17 00:00:00 2001 From: Bevan Weiss Date: Sun, 23 Jun 2024 14:48:54 +1000 Subject: Added some comments for the menu. And a fix up for the tests not launching the first try (due to delayed expansion). Also fixed up the copying of the debugger files. --- src/test/sandbox/runtest_menu.bat | 35 +++++++++++++++++++++++++++++------ src/test/sandbox/setup_sandbox.bat | 11 +++++++---- 2 files changed, 36 insertions(+), 10 deletions(-) (limited to 'src/test') diff --git a/src/test/sandbox/runtest_menu.bat b/src/test/sandbox/runtest_menu.bat index 275199fe..cd11a553 100644 --- a/src/test/sandbox/runtest_menu.bat +++ b/src/test/sandbox/runtest_menu.bat @@ -1,6 +1,11 @@ @setlocal EnableDelayedExpansion @echo off +REM We look to see if there's a debugger available in the injected sandbox folder +REM from the host. If there is, we'll show it as a launch option (later) for the +REM user. +REM If we do offer the debugger, we better show the IP address too, since it seems +REM to change for each invocation of the Sandbox environment for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a @if %PROCESSOR_ARCHITECTURE%=="ARM64" ( @if exist C:\sandbox\Debugger\ARM64\msvsmon.exe ( @@ -15,17 +20,22 @@ for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a :TestSelect cls REM Show the test select menu + +REM We start with an entry for the Debugger if available set index=0 if not "%MsVsMonPath%"=="" ( - echo [!index!] Run Remote Debugger SandboxIP=%IPAddr% + echo [!index!] Run Remote Debugger [SandboxIP=%IPAddr%] set "option[!index!]=%MsVsMonPath%" ) +REM And then for each 'runtests.cmd' file we find for /f %%i in ('where /R c:\build runtests.cmd') do ( set /A "index+=1" echo [!index!] %%i set "option[!index!]=%%i!" ) + +REM and finally an option to quit the menu echo [q] Quit set /P "SelectTest=Please Choose The Test You Want To Execute: " @@ -40,12 +50,25 @@ goto TestSelect :TestSet set "TestIs=!option[%SelectTest%]!" -for %%a in (%TestIs%) do set FileDir=%%~dpa -for %%a in (%TestIs%) do set FileName=%%~nxa -start /D %FileDir% %FileName% -if %SelectTest%==0 ( -goto TestSelect +if not "%SelectTest%"=="0" ( + REM for the non-Debugger options, we want to get the basepath + REM the file name, and a TestName component.. + for %%a in (%TestIs%) do set FileDir=%%~dpa + for %%b in (%TestIs%) do set FileName=%%~nxb + + REM since we start from C:\build, the 3rd token in '\' is + REM the 'IntegrationMsi' naming that looks good for a TestName + for /f "tokens=3 delims=\" %%c in ("%TestIs%") do ( + set TestName=%%c + ) + + REM We just start these as a separate window + REM and use cmd.exe /K to keep it around after execution has finished + start "!TestName!" /D "!FileDir!" cmd.exe /K !FileName! +) else ( + start !TestIs! ) +goto TestSelect :End @endlocal \ No newline at end of file diff --git a/src/test/sandbox/setup_sandbox.bat b/src/test/sandbox/setup_sandbox.bat index 235f6724..a3f0bbfe 100644 --- a/src/test/sandbox/setup_sandbox.bat +++ b/src/test/sandbox/setup_sandbox.bat @@ -24,10 +24,13 @@ if "!VsInstallDir!"=="" ( set VsInstallDir=%%i ) ) -if "!VsInstallDir!"=="" ( - set /P "Confirm=Have found VisualStudio Debugger at '%VsInstallDir%', Do you wish to copy it for use by the Sandbox? (Y / N):" - if "%Confirm%"=="Y" ( - XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E +if not "!VsInstallDir!"=="" ( + echo. + echo Have found VisualStudio Debugger at '%VsInstallDir%' + set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):" + echo Confirm = %Confirm% + @if "%Confirm%"=="Y" or "%Confirm%"="y" ( + XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E /Y ) ) -- cgit v1.2.3-55-g6feb