Skip to content

Commit f20ff95

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 ae1f4ca commit f20ff95

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

utils/build.ps1

+22-18
Original file line numberDiff line numberDiff line change
@@ -2283,25 +2283,31 @@ function Write-SDKSettingsPlist([Platform]$Platform, $Arch) {
22832283
$SDKSettings | ConvertTo-JSON | Out-FIle -FilePath "$(Get-SwiftSDK $Platform)\SDKSettings.json"
22842284
}
22852285

2286-
function Build-Dispatch([Platform]$Platform, $Arch, [switch]$Test = $false) {
2287-
Invoke-IsolatingEnvVars {
2288-
if ($Test) {
2289-
$Targets = @("default", "ExperimentalTest")
2290-
$InstallPath = ""
2291-
$env:CTEST_OUTPUT_ON_FAILURE = "YES"
2292-
} else {
2293-
$Targets = @("install")
2294-
$InstallPath = "$(Get-SwiftSDK $Platform)\usr"
2286+
function Build-Dispatch([Platform]$Platform, $Arch) {
2287+
Build-CMakeProject `
2288+
-Src $SourceCache\swift-corelibs-libdispatch `
2289+
-Bin (Get-ProjectBinaryCache $Arch Dispatch) `
2290+
-InstallTo "$(Get-SwiftSDK $Platform)\usr" `
2291+
-Arch $Arch `
2292+
-Platform $Platform `
2293+
-SwiftSDK (Get-SwiftSDK $Platform) `
2294+
-UseBuiltCompilers C,CXX,Swift `
2295+
-Defines @{
2296+
ENABLE_SWIFT = "YES";
22952297
}
2298+
}
2299+
2300+
function Test-Dispatch {
2301+
Invoke-IsolatingEnvVars {
2302+
$env:CTEST_OUTPUT_ON_FAILURE = "YES"
22962303

22972304
Build-CMakeProject `
22982305
-Src $SourceCache\swift-corelibs-libdispatch `
2299-
-Bin (Get-ProjectBinaryCache $Arch Dispatch) `
2300-
-InstallTo $InstallPath `
2301-
-Arch $Arch `
2302-
-Platform $Platform `
2303-
-BuildTargets $Targets `
2304-
-SwiftSDK (Get-SwiftSDK $Platform) `
2306+
-Bin (Get-ProjectBinaryCache $BuildArch Dispatch) `
2307+
-Arch $BuildArch `
2308+
-Platform Windows `
2309+
-SwiftSDK (Get-SwiftSDK Windows) `
2310+
-BuildTargets default,ExperimentalTest `
23052311
-UseBuiltCompilers C,CXX,Swift `
23062312
-Defines @{
23072313
ENABLE_SWIFT = "YES";
@@ -3287,9 +3293,7 @@ if (-not $IsCrossCompiling) {
32873293
Build-Compilers $HostArch @Tests
32883294
}
32893295

3290-
if ($Test -contains "dispatch") {
3291-
Build-Dispatch Windows $HostArch -Test
3292-
}
3296+
if ($Test -contains "dispatch") { Test-Dispatch }
32933297
if ($Test -contains "foundation") { Test-Foundation }
32943298
if ($Test -contains "xctest") { Test-XCTest }
32953299
if ($Test -contains "testing") { Test-Testing }

0 commit comments

Comments
 (0)