Skip to content

Commit 4405251

Browse files
committed
[tests] Run swift-(corelibs-)foundation tests in debug configuration on Windows
This should improve CI times because building in debug configuration instead of release configuration is significantly faster. Since we don’t install the build of swift-(corelibs-)foundation using SwiftPM into the toolchain, this doesn’t have any performance impact on users of the toolchain.
1 parent cfb9eda commit 4405251

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

utils/build.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ The memory allocator used in the toolchain binaries, if it's
107107
`mimalloc`, it uses mimalloc. Otherwise, it uses the default
108108
allocator.
109109
110+
.PARAMETER FoundationTestConfiguration
111+
Whether to run swift-foundation and swift-corelibs-foundation tests in a debug or release configuration.
112+
110113
.EXAMPLE
111114
PS> .\Build.ps1
112115
@@ -142,6 +145,8 @@ param(
142145
[switch] $Clean,
143146
[switch] $DebugInfo,
144147
[switch] $EnableCaching,
148+
[ValidateSet("debug", "release")]
149+
[string] $FoundationTestConfiguration = "debug",
145150
[string] $Cache = "",
146151
[string] $Allocator = "",
147152
[switch] $Summary,
@@ -1234,6 +1239,7 @@ function Build-SPMProject {
12341239
[string] $Src,
12351240
[string] $Bin,
12361241
[hashtable] $Arch,
1242+
[string] $Configuration = "release",
12371243
[Parameter(ValueFromRemainingArguments)]
12381244
[string[]] $AdditionalArguments
12391245
)
@@ -1263,7 +1269,7 @@ function Build-SPMProject {
12631269
$Arguments = @(
12641270
"--scratch-path", $Bin,
12651271
"--package-path", $Src,
1266-
"-c", "release",
1272+
"-c", $Configuration,
12671273
"-Xbuild-tools-swiftc", "-I$SDKInstallRoot\usr\lib\swift",
12681274
"-Xbuild-tools-swiftc", "-L$SDKInstallRoot\usr\lib\swift\windows",
12691275
"-Xcc", "-I$SDKInstallRoot\usr\lib\swift",
@@ -1851,7 +1857,8 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
18511857
-Action Test `
18521858
-Src $SourceCache\swift-foundation `
18531859
-Bin $OutDir `
1854-
-Arch $HostArch
1860+
-Arch $HostArch `
1861+
-Configuration $FoundationTestConfiguration
18551862
}
18561863

18571864
$OutDir = Join-Path -Path $HostArch.BinaryCache -ChildPath foundation-tests
@@ -1869,7 +1876,8 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
18691876
-Action Test `
18701877
-Src $SourceCache\swift-corelibs-foundation `
18711878
-Bin $OutDir `
1872-
-Arch $HostArch
1879+
-Arch $HostArch `
1880+
-Configuration $FoundationTestConfiguration
18731881
}
18741882
} else {
18751883
$DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch

0 commit comments

Comments
 (0)