Skip to content

Commit 2bc969c

Browse files
committed
utils: split Build-Dispatch into Build- and Test- function
Split up the test routines from the build routines. This is motivated by the desire to simplify (remove logic flow) and to help get more accurate timing data.
1 parent a8f9b63 commit 2bc969c

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

utils/build.ps1

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,25 +2277,31 @@ function Write-SDKSettingsPlist([Platform]$Platform, $Arch) {
22772277
$SDKSettings | ConvertTo-JSON | Out-FIle -FilePath "$(Get-SwiftSDK $Platform)\SDKSettings.json"
22782278
}
22792279

2280-
function Build-Dispatch([Platform]$Platform, $Arch, [switch]$Test = $false) {
2281-
Invoke-IsolatingEnvVars {
2282-
if ($Test) {
2283-
$Targets = @("default", "ExperimentalTest")
2284-
$InstallPath = ""
2285-
$env:CTEST_OUTPUT_ON_FAILURE = "YES"
2286-
} else {
2287-
$Targets = @("install")
2288-
$InstallPath = "$(Get-SwiftSDK $Platform)\usr"
2280+
function Build-Dispatch([Platform]$Platform, $Arch) {
2281+
Build-CMakeProject `
2282+
-Src $SourceCache\swift-corelibs-libdispatch `
2283+
-Bin (Get-ProjectBinaryCache $Arch Dispatch) `
2284+
-InstallTo "$(Get-SwiftSDK $Platform)\usr" `
2285+
-Arch $Arch `
2286+
-Platform $Platform `
2287+
-UseBuiltCompilers C,CXX,Swift `
2288+
-Defines @{
2289+
ENABLE_SWIFT = "YES";
22892290
}
2291+
}
2292+
2293+
function Test-Dispatch {
2294+
Invoke-IsolatingEnvVars {
2295+
$env:CTEST_OUTPUT_ON_FAILURE = "YES"
22902296

22912297
Build-CMakeProject `
22922298
-Src $SourceCache\swift-corelibs-libdispatch `
2293-
-Bin (Get-ProjectBinaryCache $Arch Dispatch) `
2294-
-InstallTo $InstallPath `
2295-
-Arch $Arch `
2296-
-Platform $Platform `
2299+
-Bin (Get-ProjectBinaryCache $BuildArch Dispatch) `
2300+
-Arch $BuildArch `
2301+
-Platform Windows `
22972302
-BuildTargets $Targets `
2298-
-SwiftSDK (Get-SwiftSDK $Platform) `
2303+
-SwiftSDK (Get-SwiftSDK Windows) `
2304+
-BuildTargets default,ExperimentalTest `
22992305
-UseBuiltCompilers C,CXX,Swift `
23002306
-Defines @{
23012307
ENABLE_SWIFT = "YES";
@@ -3280,9 +3286,7 @@ if (-not $IsCrossCompiling) {
32803286
Build-Compilers $HostArch @Tests
32813287
}
32823288

3283-
if ($Test -contains "dispatch") {
3284-
Build-Dispatch Windows $HostArch -Test
3285-
}
3289+
if ($Test -contains "dispatch") { Test-Dispatch }
32863290
if ($Test -contains "foundation") { Test-Foundation }
32873291
if ($Test -contains "xctest") { Test-XCTest }
32883292
if ($Test -contains "testing") { Test-Testing }

0 commit comments

Comments
 (0)