Skip to content

Commit 2ea70b3

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 f99db42 commit 2ea70b3

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

utils/build.ps1

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,24 +2317,29 @@ function Write-SDKSettingsPlist([Platform]$Platform, $Arch) {
23172317
$SDKSettings | ConvertTo-JSON | Out-FIle -FilePath "$(Get-SwiftSDK $Platform)\SDKSettings.json"
23182318
}
23192319

2320-
function Build-Dispatch([Platform]$Platform, $Arch, [switch]$Test = $false) {
2321-
Invoke-IsolatingEnvVars {
2322-
if ($Test) {
2323-
$Targets = @("default", "ExperimentalTest")
2324-
$InstallPath = ""
2325-
$env:CTEST_OUTPUT_ON_FAILURE = "YES"
2326-
} else {
2327-
$Targets = @("install")
2328-
$InstallPath = "$(Get-SwiftSDK $Platform)\usr"
2320+
function Build-Dispatch([Platform]$Platform, $Arch) {
2321+
Build-CMakeProject `
2322+
-Src $SourceCache\swift-corelibs-libdispatch `
2323+
-Bin (Get-TargetProjectBinaryCache $Arch Dispatch) `
2324+
-InstallTo "$(Get-SwiftSDK $Platform)\usr" `
2325+
-Arch $Arch `
2326+
-Platform $Platform `
2327+
-UseBuiltCompilers C,CXX,Swift `
2328+
-Defines @{
2329+
ENABLE_SWIFT = "YES";
23292330
}
2331+
}
2332+
2333+
function Test-Dispatch {
2334+
Invoke-IsolatingEnvVars {
2335+
$env:CTEST_OUTPUT_ON_FAILURE = "YES"
23302336

23312337
Build-CMakeProject `
23322338
-Src $SourceCache\swift-corelibs-libdispatch `
23332339
-Bin (Get-TargetProjectBinaryCache $Arch Dispatch) `
2334-
-InstallTo $InstallPath `
23352340
-Arch $Arch `
23362341
-Platform $Platform `
2337-
-BuildTargets $Targets `
2342+
-BuildTargets default,ExperimentalTest `
23382343
-UseBuiltCompilers C,CXX,Swift `
23392344
-Defines @{
23402345
ENABLE_SWIFT = "YES";
@@ -3380,9 +3385,7 @@ if (-not $IsCrossCompiling) {
33803385
Build-Compilers $HostArch @Tests
33813386
}
33823387

3383-
if ($Test -contains "dispatch") {
3384-
Build-Dispatch Windows $HostArch -Test
3385-
}
3388+
if ($Test -contains "dispatch") { Test-Dispatch }
33863389
if ($Test -contains "foundation") { Test-Foundation }
33873390
if ($Test -contains "xctest") { Test-XCTest }
33883391
if ($Test -contains "testing") { Test-Testing }

0 commit comments

Comments
 (0)