@@ -215,6 +215,7 @@ $ArchX64 = @{
215
215
PlatformInstallRoot = " $BinaryCache \x64\Windows.platform" ;
216
216
SDKInstallRoot = " $BinaryCache \x64\Windows.platform\Developer\SDKs\Windows.sdk" ;
217
217
XCTestInstallRoot = " $BinaryCache \x64\Windows.platform\Developer\Library\XCTest-development" ;
218
+ SwiftTestingInstallRoot = " $BinaryCache \x64\Windows.platform\Developer\Library\Testing-development" ;
218
219
ToolchainInstallRoot = " $BinaryCache \x64\toolchains\$ProductVersion +Asserts" ;
219
220
}
220
221
@@ -230,6 +231,7 @@ $ArchX86 = @{
230
231
PlatformInstallRoot = " $BinaryCache \x86\Windows.platform" ;
231
232
SDKInstallRoot = " $BinaryCache \x86\Windows.platform\Developer\SDKs\Windows.sdk" ;
232
233
XCTestInstallRoot = " $BinaryCache \x86\Windows.platform\Developer\Library\XCTest-development" ;
234
+ SwiftTestingInstallRoot = " $BinaryCache \x86\Windows.platform\Developer\Library\Testing-development" ;
233
235
}
234
236
235
237
$ArchARM64 = @ {
@@ -245,6 +247,7 @@ $ArchARM64 = @{
245
247
SDKInstallRoot = " $BinaryCache \arm64\Windows.platform\Developer\SDKs\Windows.sdk" ;
246
248
XCTestInstallRoot = " $BinaryCache \arm64\Windows.platform\Developer\Library\XCTest-development" ;
247
249
ToolchainInstallRoot = " $BinaryCache \arm64\toolchains\$ProductVersion +Asserts" ;
250
+ SwiftTestingInstallRoot = " $BinaryCache \arm64\Windows.platform\Developer\Library\Testing-development" ;
248
251
}
249
252
250
253
$AndroidARM64 = @ {
@@ -258,6 +261,7 @@ $AndroidARM64 = @{
258
261
PlatformInstallRoot = " $BinaryCache \arm64\Android.platform" ;
259
262
SDKInstallRoot = " $BinaryCache \arm64\Android.platform\Developer\SDKs\Android.sdk" ;
260
263
XCTestInstallRoot = " $BinaryCache \arm64\Android.platform\Developer\Library\XCTest-development" ;
264
+ SwiftTestingInstallRoot = " $BinaryCache \arm64\Android.platform\Developer\Library\Testing-development" ;
261
265
}
262
266
263
267
$AndroidARMv7 = @ {
@@ -271,6 +275,7 @@ $AndroidARMv7 = @{
271
275
PlatformInstallRoot = " $BinaryCache \armv7\Android.platform" ;
272
276
SDKInstallRoot = " $BinaryCache \armv7\Android.platform\Developer\SDKs\Android.sdk" ;
273
277
XCTestInstallRoot = " $BinaryCache \armv7\Android.platform\Developer\Library\XCTest-development" ;
278
+ SwiftTestingInstallRoot = " $BinaryCache \armv7\Android.platform\Developer\Library\Testing-development" ;
274
279
}
275
280
276
281
$AndroidX86 = @ {
@@ -284,6 +289,7 @@ $AndroidX86 = @{
284
289
PlatformInstallRoot = " $BinaryCache \x86\Android.platform" ;
285
290
SDKInstallRoot = " $BinaryCache \x86\Android.platform\Developer\SDKs\Android.sdk" ;
286
291
XCTestInstallRoot = " $BinaryCache \x86\Android.platform\Developer\Library\XCTest-development" ;
292
+ SwiftTestingInstallRoot = " $BinaryCache \x86\Android.platform\Developer\Library\Testing-development" ;
287
293
}
288
294
289
295
$AndroidX64 = @ {
@@ -297,6 +303,7 @@ $AndroidX64 = @{
297
303
PlatformInstallRoot = " $BinaryCache \x64\Android.platform" ;
298
304
SDKInstallRoot = " $BinaryCache \x64\Android.platform\Developer\SDKs\Android.sdk" ;
299
305
XCTestInstallRoot = " $BinaryCache \x64\Android.platform\Developer\Library\XCTest-development" ;
306
+ SwiftTestingInstallRoot = " $BinaryCache \x64\Android.platform\Developer\Library\Testing-development" ;
300
307
}
301
308
302
309
$HostArch = switch ($HostArchName ) {
@@ -387,6 +394,7 @@ enum TargetComponent {
387
394
Dispatch
388
395
Foundation
389
396
XCTest
397
+ SwiftTesting
390
398
}
391
399
392
400
function Get-TargetProjectBinaryCache ($Arch , [TargetComponent ]$Project ) {
@@ -413,6 +421,7 @@ enum HostComponent {
413
421
LMDB
414
422
SymbolKit
415
423
DocC
424
+ SwiftTestingMacros
416
425
}
417
426
418
427
function Get-HostProjectBinaryCache ([HostComponent ]$Project ) {
@@ -1731,11 +1740,43 @@ function Build-XCTest([Platform]$Platform, $Arch, [switch]$Test = $false) {
1731
1740
dispatch_DIR = " $DispatchBinaryCache \cmake\modules" ;
1732
1741
Foundation_DIR = " $FoundationBinaryCache \cmake\modules" ;
1733
1742
} + $TestingDefines )
1743
+ }
1744
+ }
1745
+
1746
+ function Build-SwiftTesting ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
1747
+ $SwiftTestingBinaryCache = Get-TargetProjectBinaryCache $Arch SwiftTesting
1748
+
1749
+ Isolate- EnvVars {
1750
+ if ($Test ) {
1751
+ # TODO: Test
1752
+ return
1753
+ } else {
1754
+ $Targets = @ (" default" )
1755
+ $InstallPath = " $ ( $Arch.SwiftTestingInstallRoot ) \usr"
1756
+ }
1734
1757
1758
+ Build-CMakeProject `
1759
+ - Src $SourceCache \swift- testing `
1760
+ - Bin $SwiftTestingBinaryCache `
1761
+ - InstallTo $InstallPath `
1762
+ - Arch $Arch `
1763
+ - Platform $Platform `
1764
+ - UseBuiltCompilers C, CXX, Swift `
1765
+ - BuildTargets $Targets `
1766
+ - Defines (@ {
1767
+ BUILD_SHARED_LIBS = " YES" ;
1768
+ CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
1769
+ SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
1770
+ # FIXME: Build the plugin for the builder and specify the path.
1771
+ SwiftTesting_MACRO = " NO" ;
1772
+ })
1773
+ }
1774
+ }
1775
+
1776
+ function Write-PlatformInfoPlist ($Arch ) {
1735
1777
$PList = Join-Path - Path $Arch.PlatformInstallRoot - ChildPath " Info.plist"
1736
- Invoke-Program $python - c " import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development', 'SWIFTC_FLAGS': ['-use-ld=lld'] } }), encoding='utf-8'))" `
1778
+ Invoke-Program $python - c " import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development', 'SWIFT_TESTING_VERSION': 'development', ' SWIFTC_FLAGS': ['-use-ld=lld'] } }), encoding='utf-8'))" `
1737
1779
- OutFile " $PList "
1738
- }
1739
1780
}
1740
1781
1741
1782
# Copies files installed by CMake from the arch-specific platform root,
@@ -2165,6 +2206,21 @@ function Build-SourceKitLSP($Arch) {
2165
2206
}
2166
2207
}
2167
2208
2209
+ function Build-SwiftTestingMacros ($Arch ) {
2210
+ Build-CMakeProject `
2211
+ - Src $SourceCache \swift- testing\Sources\TestingMacros `
2212
+ - Bin (Get-HostProjectBinaryCache SwiftTestingMacros) `
2213
+ - InstallTo " $ ( $Arch.ToolchainInstallRoot ) \usr" `
2214
+ - Arch $Arch `
2215
+ - Platform Windows `
2216
+ - UseBuiltCompilers Swift `
2217
+ - SwiftSDK (Get-HostSwiftSDK ) `
2218
+ - BuildTargets default `
2219
+ - Defines @ {
2220
+ SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2221
+ }
2222
+ }
2223
+
2168
2224
function Install-HostToolchain () {
2169
2225
if ($ToBatch ) { return }
2170
2226
@@ -2323,20 +2379,24 @@ if (-not $SkipBuild) {
2323
2379
Invoke-BuildStep Build-Dispatch Windows $Arch
2324
2380
Invoke-BuildStep Build-Foundation Windows $Arch
2325
2381
Invoke-BuildStep Build-XCTest Windows $Arch
2382
+ Invoke-BuildStep Build-SwiftTesting Windows $Arch
2383
+ Invoke-BuildStep Write-PlatformInfoPlist $Arch
2326
2384
}
2327
2385
2328
- foreach ($Arch in $AndroidSDKArchs ) {
2329
- Invoke-BuildStep Build-ZLib Android $Arch
2330
- Invoke-BuildStep Build-XML2 Android $Arch
2331
- Invoke-BuildStep Build-CURL Android $Arch
2332
- Invoke-BuildStep Build-LLVM Android $Arch
2386
+ foreach ($Arch in $AndroidSDKArchs ) {
2387
+ Invoke-BuildStep Build-ZLib Android $Arch
2388
+ Invoke-BuildStep Build-XML2 Android $Arch
2389
+ Invoke-BuildStep Build-CURL Android $Arch
2390
+ Invoke-BuildStep Build-LLVM Android $Arch
2333
2391
2334
- # Build platform: SDK, Redist and XCTest
2335
- Invoke-BuildStep Build-Runtime Android $Arch
2336
- Invoke-BuildStep Build-Dispatch Android $Arch
2337
- Invoke-BuildStep Build-Foundation Android $Arch
2338
- Invoke-BuildStep Build-XCTest Android $Arch
2339
- }
2392
+ # Build platform: SDK, Redist and XCTest
2393
+ Invoke-BuildStep Build-Runtime Android $Arch
2394
+ Invoke-BuildStep Build-Dispatch Android $Arch
2395
+ Invoke-BuildStep Build-Foundation Android $Arch
2396
+ Invoke-BuildStep Build-XCTest Android $Arch
2397
+ Invoke-BuildStep Build-SwiftTesting Android $Arch
2398
+ Invoke-BuildStep Write-PlatformInfoPlist $Arch
2399
+ }
2340
2400
}
2341
2401
2342
2402
if (-not $ToBatch ) {
@@ -2358,6 +2418,7 @@ if (-not $ToBatch) {
2358
2418
}
2359
2419
2360
2420
if (-not $SkipBuild ) {
2421
+ Invoke-BuildStep Build-SwiftTestingMacros $HostArch
2361
2422
Invoke-BuildStep Build-SQLite $HostArch
2362
2423
Invoke-BuildStep Build-System $HostArch
2363
2424
Invoke-BuildStep Build-ToolsSupportCore $HostArch
@@ -2412,6 +2473,9 @@ if (-not $IsCrossCompiling) {
2412
2473
if ($Test -contains " xctest" ) {
2413
2474
Build-XCTest Windows $HostArch - Test
2414
2475
}
2476
+ if ($Test -contains " testing" ) {
2477
+ Build-SwiftTesting Windows $HostArch - Test
2478
+ }
2415
2479
if ($Test -contains " llbuild" ) { Build-LLBuild $HostArch - Test }
2416
2480
if ($Test -contains " swiftpm" ) { Test-PackageManager $HostArch }
2417
2481
}
0 commit comments