Skip to content

Commit f7c3a4c

Browse files
committed
utils: rework Build-Testing to exclude -Test
Simplify the `Build-Testing` call to simply build swift testing for distribution. The testing support was never implemented and there was more duplication than necessary.
1 parent 4b7de1e commit f7c3a4c

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

utils/build.ps1

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,35 +2360,23 @@ function Test-XCTest {
23602360
}
23612361
}
23622362

2363-
function Build-Testing([Platform]$Platform, $Arch, [switch]$Test = $false) {
2364-
$DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
2365-
$FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch DynamicFoundation
2366-
$SwiftTestingBinaryCache = Get-TargetProjectBinaryCache $Arch Testing
2367-
2368-
Isolate-EnvVars {
2369-
if ($Test) {
2370-
# TODO: Test
2371-
return
2372-
} else {
2373-
$InstallPath = "$($Arch.SwiftTestingInstallRoot)\usr"
2363+
function Build-Testing([Platform]$Platform, $Arch) {
2364+
Build-CMakeProject `
2365+
-Src $SourceCache\swift-testing `
2366+
-Bin (Get-TargetProjectBinaryCache $Arch Testing) `
2367+
-InstallTo "$($Arch.SwiftTestingInstallRoot)\usr" `
2368+
-Arch $Arch `
2369+
-Platform $Platform `
2370+
-UseBuiltCompilers C,CXX,Swift `
2371+
-Defines @{
2372+
BUILD_SHARED_LIBS = "YES";
2373+
CMAKE_BUILD_WITH_INSTALL_RPATH = "YES";
2374+
dispatch_DIR = (Get-TargetProjectCMakeModules $Arch Dispatch);
2375+
Foundation_DIR = (Get-TargetProjectCMakeModules $Arch DynamicFoundation);
2376+
# TODO: ensure that host and target platform match
2377+
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2378+
SwiftTesting_MACRO = "$(Get-BuildProjectBinaryCache TestingMacros)\TestingMacros.dll";
23742379
}
2375-
2376-
Build-CMakeProject `
2377-
-Src $SourceCache\swift-testing `
2378-
-Bin $SwiftTestingBinaryCache `
2379-
-InstallTo $InstallPath `
2380-
-Arch $Arch `
2381-
-Platform $Platform `
2382-
-UseBuiltCompilers C,CXX,Swift `
2383-
-Defines (@{
2384-
BUILD_SHARED_LIBS = "YES";
2385-
CMAKE_BUILD_WITH_INSTALL_RPATH = "YES";
2386-
dispatch_DIR = "$DispatchBinaryCache\cmake\modules";
2387-
Foundation_DIR = "$FoundationBinaryCache\cmake\modules";
2388-
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2389-
SwiftTesting_MACRO = "$(Get-BuildProjectBinaryCache TestingMacros)\TestingMacros.dll";
2390-
})
2391-
}
23922380
}
23932381

23942382
function Write-PlatformInfoPlist([Platform] $Platform) {

0 commit comments

Comments
 (0)