diff options
author | Bevan Weiss <bevan.weiss@gmail.com> | 2024-06-23 14:48:54 +1000 |
---|---|---|
committer | Bob Arnson <github@bobs.org> | 2024-07-04 19:25:49 -0400 |
commit | 491ffc337a9f5688caccc18cc489bce8056858b6 (patch) | |
tree | 92dba5312549f2adefc0921b88b032104bc50038 /src/test | |
parent | d2582c7bdbb09513849b36a49b5f992c2bc58e78 (diff) | |
download | wix-491ffc337a9f5688caccc18cc489bce8056858b6.tar.gz wix-491ffc337a9f5688caccc18cc489bce8056858b6.tar.bz2 wix-491ffc337a9f5688caccc18cc489bce8056858b6.zip |
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.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/sandbox/runtest_menu.bat | 35 | ||||
-rw-r--r-- | src/test/sandbox/setup_sandbox.bat | 11 |
2 files changed, 36 insertions, 10 deletions
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 @@ | |||
1 | @setlocal EnableDelayedExpansion | 1 | @setlocal EnableDelayedExpansion |
2 | @echo off | 2 | @echo off |
3 | 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 | ||
4 | for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a | 9 | for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a |
5 | @if %PROCESSOR_ARCHITECTURE%=="ARM64" ( | 10 | @if %PROCESSOR_ARCHITECTURE%=="ARM64" ( |
6 | @if exist C:\sandbox\Debugger\ARM64\msvsmon.exe ( | 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 | |||
15 | :TestSelect | 20 | :TestSelect |
16 | cls | 21 | cls |
17 | REM Show the test select menu | 22 | REM Show the test select menu |
23 | |||
24 | REM We start with an entry for the Debugger if available | ||
18 | set index=0 | 25 | set index=0 |
19 | if not "%MsVsMonPath%"=="" ( | 26 | if not "%MsVsMonPath%"=="" ( |
20 | echo [!index!] Run Remote Debugger SandboxIP=%IPAddr% | 27 | echo [!index!] Run Remote Debugger [SandboxIP=%IPAddr%] |
21 | set "option[!index!]=%MsVsMonPath%" | 28 | set "option[!index!]=%MsVsMonPath%" |
22 | ) | 29 | ) |
23 | 30 | ||
31 | REM And then for each 'runtests.cmd' file we find | ||
24 | for /f %%i in ('where /R c:\build runtests.cmd') do ( | 32 | for /f %%i in ('where /R c:\build runtests.cmd') do ( |
25 | set /A "index+=1" | 33 | set /A "index+=1" |
26 | echo [!index!] %%i | 34 | echo [!index!] %%i |
27 | set "option[!index!]=%%i!" | 35 | set "option[!index!]=%%i!" |
28 | ) | 36 | ) |
37 | |||
38 | REM and finally an option to quit the menu | ||
29 | echo [q] Quit | 39 | echo [q] Quit |
30 | 40 | ||
31 | set /P "SelectTest=Please Choose The Test You Want To Execute: " | 41 | set /P "SelectTest=Please Choose The Test You Want To Execute: " |
@@ -40,12 +50,25 @@ goto TestSelect | |||
40 | 50 | ||
41 | :TestSet | 51 | :TestSet |
42 | set "TestIs=!option[%SelectTest%]!" | 52 | set "TestIs=!option[%SelectTest%]!" |
43 | for %%a in (%TestIs%) do set FileDir=%%~dpa | 53 | if not "%SelectTest%"=="0" ( |
44 | for %%a in (%TestIs%) do set FileName=%%~nxa | 54 | REM for the non-Debugger options, we want to get the basepath |
45 | start /D %FileDir% %FileName% | 55 | REM the file name, and a TestName component.. |
46 | if %SelectTest%==0 ( | 56 | for %%a in (%TestIs%) do set FileDir=%%~dpa |
47 | goto TestSelect | 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! | ||
48 | ) | 70 | ) |
71 | goto TestSelect | ||
49 | 72 | ||
50 | :End | 73 | :End |
51 | @endlocal \ No newline at end of file | 74 | @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!"=="" ( | |||
24 | set VsInstallDir=%%i | 24 | set VsInstallDir=%%i |
25 | ) | 25 | ) |
26 | ) | 26 | ) |
27 | if "!VsInstallDir!"=="" ( | 27 | if not "!VsInstallDir!"=="" ( |
28 | set /P "Confirm=Have found VisualStudio Debugger at '%VsInstallDir%', Do you wish to copy it for use by the Sandbox? (Y / N):" | 28 | echo. |
29 | if "%Confirm%"=="Y" ( | 29 | echo Have found VisualStudio Debugger at '%VsInstallDir%' |
30 | XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E | 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 | ||
31 | ) | 34 | ) |
32 | ) | 35 | ) |
33 | 36 | ||