@joebigelow / wix / commits / 491ffc33

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.

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.

Bevan Weiss committed Jun 23, 2024 at 14:48 UTC 491ffc337a9f5688caccc18cc489bce8056858b6
2 files changed +36 -10
src/test/sandbox/runtest_menu.bat
+29 -6
@@ -1,6 +1,11 @@
1 @setlocal EnableDelayedExpansion
2 @echo off
3
4 +REM We look to see if there's a debugger available in the injected sandbox folder
5 +REM from the host. If there is, we'll show it as a launch option (later) for the
6 +REM user.
7 +REM If we do offer the debugger, we better show the IP address too, since it seems
8 +REM to change for each invocation of the Sandbox environment
9 for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a
10 @if %PROCESSOR_ARCHITECTURE%=="ARM64" (
11 @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
20 :TestSelect
21 cls
22 REM Show the test select menu
23 +
24 +REM We start with an entry for the Debugger if available
25 set index=0
26 if not "%MsVsMonPath%"=="" (
20 - echo [!index!] Run Remote Debugger SandboxIP=%IPAddr%
27 + echo [!index!] Run Remote Debugger [SandboxIP=%IPAddr%]
28 set "option[!index!]=%MsVsMonPath%"
29 )
30
31 +REM And then for each 'runtests.cmd' file we find
32 for /f %%i in ('where /R c:\build runtests.cmd') do (
33 set /A "index+=1"
34 echo [!index!] %%i
35 set "option[!index!]=%%i!"
36 )
37 +
38 +REM and finally an option to quit the menu
39 echo [q] Quit
40
41 set /P "SelectTest=Please Choose The Test You Want To Execute: "
@@ -40,12 +50,25 @@ goto TestSelect
50
51 :TestSet
52 set "TestIs=!option[%SelectTest%]!"
43 -for %%a in (%TestIs%) do set FileDir=%%~dpa
44 -for %%a in (%TestIs%) do set FileName=%%~nxa
45 -start /D %FileDir% %FileName%
46 -if %SelectTest%==0 (
47 -goto TestSelect
53 +if not "%SelectTest%"=="0" (
54 + REM for the non-Debugger options, we want to get the basepath
55 + REM the file name, and a TestName component..
56 + for %%a in (%TestIs%) do set FileDir=%%~dpa
57 + for %%b in (%TestIs%) do set FileName=%%~nxb
58 +
59 + REM since we start from C:\build, the 3rd token in '\' is
60 + REM the 'IntegrationMsi' naming that looks good for a TestName
61 + for /f "tokens=3 delims=\" %%c in ("%TestIs%") do (
62 + set TestName=%%c
63 + )
64 +
65 + REM We just start these as a separate window
66 + REM and use cmd.exe /K to keep it around after execution has finished
67 + start "!TestName!" /D "!FileDir!" cmd.exe /K !FileName!
68 +) else (
69 + start !TestIs!
70 )
71 +goto TestSelect
72
73 :End
74 @endlocal
\ No newline at end of file
src/test/sandbox/setup_sandbox.bat
+7 -4
@@ -24,10 +24,13 @@ if "!VsInstallDir!"=="" (
24 set VsInstallDir=%%i
25 )
26 )
27 -if "!VsInstallDir!"=="" (
28 - set /P "Confirm=Have found VisualStudio Debugger at '%VsInstallDir%', Do you wish to copy it for use by the Sandbox? (Y / N):"
29 - if "%Confirm%"=="Y" (
30 - XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E
27 +if not "!VsInstallDir!"=="" (
28 + echo.
29 + echo Have found VisualStudio Debugger at '%VsInstallDir%'
30 + set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):"
31 + echo Confirm = %Confirm%
32 + @if "%Confirm%"=="Y" or "%Confirm%"="y" (
33 + XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E /Y
34 )
35 )
36