aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBevan Weiss <bevan.weiss@gmail.com>2024-06-23 14:48:54 +1000
committerBob Arnson <github@bobs.org>2024-07-04 19:25:49 -0400
commit491ffc337a9f5688caccc18cc489bce8056858b6 (patch)
tree92dba5312549f2adefc0921b88b032104bc50038 /src/test
parentd2582c7bdbb09513849b36a49b5f992c2bc58e78 (diff)
downloadwix-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.bat35
-rw-r--r--src/test/sandbox/setup_sandbox.bat11
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
4REM We look to see if there's a debugger available in the injected sandbox folder
5REM from the host. If there is, we'll show it as a launch option (later) for the
6REM user.
7REM If we do offer the debugger, we better show the IP address too, since it seems
8REM to change for each invocation of the Sandbox environment
4for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a 9for /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
16cls 21cls
17REM Show the test select menu 22REM Show the test select menu
23
24REM We start with an entry for the Debugger if available
18set index=0 25set index=0
19if not "%MsVsMonPath%"=="" ( 26if 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
31REM And then for each 'runtests.cmd' file we find
24for /f %%i in ('where /R c:\build runtests.cmd') do ( 32for /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
38REM and finally an option to quit the menu
29echo [q] Quit 39echo [q] Quit
30 40
31set /P "SelectTest=Please Choose The Test You Want To Execute: " 41set /P "SelectTest=Please Choose The Test You Want To Execute: "
@@ -40,12 +50,25 @@ goto TestSelect
40 50
41:TestSet 51:TestSet
42set "TestIs=!option[%SelectTest%]!" 52set "TestIs=!option[%SelectTest%]!"
43for %%a in (%TestIs%) do set FileDir=%%~dpa 53if not "%SelectTest%"=="0" (
44for %%a in (%TestIs%) do set FileName=%%~nxa 54 REM for the non-Debugger options, we want to get the basepath
45start /D %FileDir% %FileName% 55 REM the file name, and a TestName component..
46if %SelectTest%==0 ( 56 for %%a in (%TestIs%) do set FileDir=%%~dpa
47goto 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)
71goto 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)
27if "!VsInstallDir!"=="" ( 27if 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