Skip to content

Commit 96f1a44

Browse files
committed
build: add support for testing more of the compilers on Windows
This adds the ability to conditionally run the test suite for LLVM, LLD, LLDB, Clang, and Swift. This will allow us to increase the test coverage in CI to avoid regressions.
1 parent ebbb9de commit 96f1a44

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

utils/build.ps1

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,18 +888,36 @@ function Build-BuildTools($Arch) {
888888
}
889889
}
890890

891-
function Build-Compilers($Arch, [switch]$Test = $false) {
891+
function Build-Compilers() {
892+
[CmdletBinding(PositionalBinding = $false)]
893+
param
894+
(
895+
[Parameter(Position = 0, Mandatory = $true)]
896+
[hashtable]$Arch,
897+
[switch]$TestClang = $false,
898+
[switch]$TestLLD = $false,
899+
[switch]$TestLLDB = $false,
900+
[switch]$TestLLVM = $false,
901+
[switch]$TestSwift = $false
902+
)
903+
892904
Isolate-EnvVars {
893-
if ($Test) {
905+
if ($TestClang -or $TestLLD -or $TestLLDB -or $TestLLVM -or $TestSwift) {
894906
$LibdispatchBinDir = "$BinaryCache\1\tools\swift\libdispatch-windows-$($Arch.LLVMName)-prefix\bin"
895-
$env:Path = "$LibdispatchBinDir;$BinaryCache\1\bin;$env:Path;$UnixToolsBinDir"
896-
$Targets = @("check-swift")
907+
$env:Path = "$LibdispatchBinDir;$BinaryCache\1\bin;$env:Path;$VSInstallRoot\DIA SDK\bin\$($HostArch.VSName);$UnixToolsBinDir"
908+
$Targets = @()
897909
$TestingDefines = @{
898910
SWIFT_BUILD_DYNAMIC_SDK_OVERLAY = "YES";
899911
SWIFT_BUILD_DYNAMIC_STDLIB = "YES";
900912
SWIFT_BUILD_REMOTE_MIRROR = "YES";
901913
SWIFT_NATIVE_SWIFT_TOOLS_PATH = "";
902914
}
915+
916+
if ($TestClang) { $Targets += @("check-clang") }
917+
if ($TestLLD) { $Targets += @("check-lld") }
918+
if ($TestLLDB) { $Targets += @("check-lldb") }
919+
if ($TestLLVM) { $Targets += @("check-llvm") }
920+
if ($TestSwift) { $Targets += @("check-swift") }
903921
} else {
904922
$Targets = @("distribution", "install-distribution")
905923
$TestingDefines = @{
@@ -1801,7 +1819,17 @@ if ($Stage) {
18011819
Stage-BuildArtifacts $HostArch
18021820
}
18031821

1804-
if ($Test -contains "swift") { Build-Compilers $HostArch -Test }
1822+
if ($Test -ne $null -and (Compare-Object $Test @("clang", "lld", "lldb", "llvm", "swift") -PassThru -IncludeEqual -ExcludeDifferent) -ne $null) {
1823+
$Tests = @{
1824+
"-TestClang" = $Test -contains "clang";
1825+
"-TestLLD" = $Test -contains "lld";
1826+
"-TestLLDB" = $Test -contains "lldb";
1827+
"-TestLLVM" = $Test -contains "llvm";
1828+
"-TestSwift" = $Test -contains "swift";
1829+
}
1830+
Build-Compilers $HostArch @Tests
1831+
}
1832+
18051833
if ($Test -contains "dispatch") { Build-Dispatch $HostArch -Test }
18061834
if ($Test -contains "foundation") { Build-Foundation $HostArch -Test }
18071835
if ($Test -contains "xctest") { Build-XCTest $HostArch -Test }

0 commit comments

Comments
 (0)