3
3
[string ] $SelectedRuntime ,
4
4
[Int32 ] $DevicesToRun = 1 ,
5
5
[Switch ] $IsIntegrationTest ,
6
- [string ] $UnityVersion = " "
6
+ [string ] $UnityVersion = " " ,
7
+ [string ] $iOSMinVersion = " "
7
8
)
8
9
Write-Host " Args received Action=$Action , SelectedRuntime=$SelectedRuntime , IsIntegrationTest=$IsIntegrationTest "
9
10
# $Action: 'Build' for build only
@@ -60,6 +61,9 @@ function Build()
60
61
- scheme " Unity-iPhone" `
61
62
- configuration " Release" `
62
63
- sdk " iphonesimulator" `
64
+ - destination " platform=iOS Simulator,OS=$iOSMinVersion " `
65
+ - destination " platform=iOS Simulator,OS=latest" `
66
+ - parallel- testing- enabled YES `
63
67
- derivedDataPath " $ArchivePath /$ProjectName " `
64
68
| Write-Host
65
69
}
@@ -84,9 +88,10 @@ function Test
84
88
{
85
89
Write-Host " Retrieving list of available simulators" - ForegroundColor Green
86
90
$deviceListRaw = xcrun simctl list devices
87
- Write-Host " Available simulators:" - ForegroundColor Green
91
+ Write-Host " ::group:: Available simulators:"
88
92
$deviceListRaw | Write-Host
89
-
93
+ Write-Host " ::endgroup::"
94
+
90
95
[AppleDevice []]$deviceList = @ ()
91
96
92
97
Write-Host " Picking simulator based on selected runtime" - ForegroundColor Green
@@ -142,39 +147,33 @@ function Test
142
147
143
148
function RunTest ([string ] $Name , [string ] $SuccessString )
144
149
{
145
- Write-Host " ::group::Test: '$name '"
146
- try
147
- {
148
- Write-Host " Launching '$Name ' test on '$ ( $device.Name ) '" - ForegroundColor Green
149
- $consoleOut = xcrun simctl launch -- console- pty $ ($device.UUID ) $AppName " --test" $Name
150
+ Write-Host " Test: '$name '"
151
+ Write-Host " Launching '$Name ' test on '$ ( $device.Name ) '" - ForegroundColor Green
152
+ $consoleOut = xcrun simctl launch -- console- pty $ ($device.UUID ) $AppName " --test" $Name
150
153
151
- if (" $SuccessString " -eq " " )
152
- {
153
- $SuccessString = " $ ( $Name.ToUpper ()) TEST: PASS"
154
- }
154
+ if (" $SuccessString " -eq " " )
155
+ {
156
+ $SuccessString = " $ ( $Name.ToUpper ()) TEST: PASS"
157
+ }
155
158
156
- Write-Host - NoNewline " '$Name ' test STATUS: "
157
- $stdout = $consoleOut | Select-String $SuccessString
158
- If ($null -ne $stdout )
159
- {
160
- Write-Host " PASSED" - ForegroundColor Green
161
- }
162
- Else
163
- {
164
- $device.TestFailed = $True
165
- Write-Host " FAILED" - ForegroundColor Red
166
- Write-Host " ===== START OF '$ ( $device.Name ) ' CONSOLE ====="
167
- foreach ($consoleLine in $consoleOut )
168
- {
169
- Write-Host $consoleLine
170
- }
171
- Write-Host " ===== END OF CONSOLE ====="
172
- }
159
+ Write-Host - NoNewline " '$Name ' test STATUS: "
160
+ $stdout = $consoleOut | Select-String $SuccessString
161
+ If ($null -ne $stdout )
162
+ {
163
+ Write-Host " PASSED" - ForegroundColor Green
173
164
}
174
- finally
165
+ Else
175
166
{
176
- Write-Host " ::endgroup::"
167
+ $device.TestFailed = $True
168
+ Write-Host " FAILED" - ForegroundColor Red
177
169
}
170
+
171
+ Write-Host " ::group::$ ( $device.Name ) Console Output"
172
+ foreach ($consoleLine in $consoleOut )
173
+ {
174
+ Write-Host $consoleLine
175
+ }
176
+ Write-Host " ::endgroup::"
178
177
}
179
178
180
179
RunTest " smoke"
0 commit comments