Skip to content

Commit 3557451

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 1c78d0c commit 3557451

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
@@ -109,6 +109,9 @@ The architecture where the toolchain will execute.
109109
.PARAMETER Variant
110110
The toolchain variant to build. Defaults to `Asserts`.
111111
112+
.PARAMETER FoundationTestConfiguration
113+
Whether to run swift-foundation and swift-corelibs-foundation tests in a debug or release configuration.
114+
112115
.EXAMPLE
113116
PS> .\Build.ps1
114117
@@ -165,6 +168,8 @@ param
165168
[switch] $Clean,
166169
[switch] $DebugInfo,
167170
[switch] $EnableCaching,
171+
[ValidateSet("debug", "release")]
172+
[string] $FoundationTestConfiguration = "debug",
168173
[string] $Cache = "",
169174
[switch] $Summary,
170175
[switch] $ToBatch
@@ -1478,6 +1483,7 @@ function Build-SPMProject {
14781483
[string] $Src,
14791484
[string] $Bin,
14801485
[hashtable] $Arch,
1486+
[string] $Configuration = "release",
14811487
[Parameter(ValueFromRemainingArguments)]
14821488
[string[]] $AdditionalArguments
14831489
)
@@ -1507,7 +1513,7 @@ function Build-SPMProject {
15071513
$Arguments = @(
15081514
"--scratch-path", $Bin,
15091515
"--package-path", $Src,
1510-
"-c", "release",
1516+
"-c", $Configuration,
15111517
"-Xbuild-tools-swiftc", "-I$(Get-SwiftSDK Windows)\usr\lib\swift",
15121518
"-Xbuild-tools-swiftc", "-L$(Get-SwiftSDK Windows)\usr\lib\swift\windows",
15131519
"-Xcc", "-I$(Get-SwiftSDK Windows)\usr\lib\swift",
@@ -2360,7 +2366,8 @@ function Build-Foundation {
23602366
-Action Test `
23612367
-Src $SourceCache\swift-foundation `
23622368
-Bin "$BinaryCache\$($Arch.LLVMTarget)\CoreFoundationTests" `
2363-
-Arch $HostArch
2369+
-Arch $HostArch `
2370+
-Configuration $FoundationTestConfiguration
23642371

23652372
$ShortArch = $Arch.LLVMName
23662373
Invoke-IsolatingEnvVars {
@@ -2374,7 +2381,8 @@ function Build-Foundation {
23742381
-Action Test `
23752382
-Src $SourceCache\swift-corelibs-foundation `
23762383
-Bin "$BinaryCache\$($Arch.LLVMTarget)\FoundationTests" `
2377-
-Arch $HostArch
2384+
-Arch $HostArch `
2385+
-Configuration $FoundationTestConfiguration
23782386
}
23792387
} else {
23802388
$DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch

0 commit comments

Comments
 (0)