Skip to content

Commit da96615

Browse files
Run non-executable Swift Runtime tests for x86_64 Android
1 parent c2e36de commit da96615

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

utils/build.ps1

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ if ($AndroidSDKs.Length -gt 0) {
220220

221221
if ($Test -contains "*") {
222222
# Explicitly don't include llbuild yet since tests are known to fail on Windows
223-
$Test = @("lld", "lldb", "swift", "dispatch", "foundation", "xctest", "swift-format", "sourcekit-lsp")
223+
$Test = @("lld", "lldb", "swift", "dispatch", "foundation", "xctest", "swift-format", "sourcekit-lsp", "android")
224224
}
225225

226226
# Architecture definitions
@@ -2033,17 +2033,22 @@ function Build-CURL([Platform]$Platform, $Arch) {
20332033
})
20342034
}
20352035

2036-
function Build-Runtime([Platform]$Platform, $Arch) {
2036+
function Build-Runtime([Platform]$Platform, $Arch, [switch]$Test = $false) {
2037+
$Targets = @("install")
20372038
$PlatformDefines = @{}
20382039
if ($Platform -eq "Android") {
20392040
$PlatformDefines += @{
20402041
LLVM_ENABLE_LIBCXX = "YES";
20412042
SWIFT_USE_LINKER = "lld";
2042-
SWIFT_INCLUDE_TESTS = "NO";
2043-
SWIFT_INCLUDE_TEST_BINARIES = "NO";
20442043
}
20452044
}
2046-
2045+
if ($Test) {
2046+
$Targets += @("check-swift-all-only_non_executable")
2047+
$PlatformDefines += @{
2048+
SWIFT_INCLUDE_TESTS = "YES";
2049+
SWIFT_BUILD_TEST_SUPPORT_MODULES = "YES";
2050+
}
2051+
}
20472052

20482053
Isolate-EnvVars {
20492054
$env:Path = "$(Get-CMarkBinaryCache $Arch)\src;$(Get-PinnedToolchainRuntime);${env:Path}"
@@ -2054,6 +2059,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
20542059
Get-HostProjectBinaryCache Compilers
20552060
}
20562061

2062+
$NativeToolsPath = Join-Path -Path $CompilersBinaryCache -ChildPath "bin"
20572063
Build-CMakeProject `
20582064
-Src $SourceCache\swift `
20592065
-Bin (Get-TargetProjectBinaryCache $Arch Runtime) `
@@ -2062,6 +2068,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
20622068
-Platform $Platform `
20632069
-CacheScript $SourceCache\swift\cmake\caches\Runtime-$Platform-$($Arch.LLVMName).cmake `
20642070
-UseBuiltCompilers C,CXX,Swift `
2071+
-BuildTargets $Targets `
20652072
-Defines ($PlatformDefines + @{
20662073
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Arch);
20672074
CMAKE_Swift_COMPILER_WORKS = "YES";
@@ -2075,7 +2082,8 @@ function Build-Runtime([Platform]$Platform, $Arch) {
20752082
SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING = "YES";
20762083
SWIFT_ENABLE_SYNCHRONIZATION = "YES";
20772084
SWIFT_ENABLE_VOLATILE = "YES";
2078-
SWIFT_NATIVE_SWIFT_TOOLS_PATH = (Join-Path -Path $CompilersBinaryCache -ChildPath "bin");
2085+
SWIFT_NATIVE_LLVM_TOOLS_PATH = $NativeToolsPath;
2086+
SWIFT_NATIVE_SWIFT_TOOLS_PATH = $NativeToolsPath;
20792087
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = "$SourceCache\swift-corelibs-libdispatch";
20802088
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = "$SourceCache\swift-experimental-string-processing";
20812089
CMAKE_SHARED_LINKER_FLAGS = if ($Platform -eq "Windows") { @("/INCREMENTAL:NO", "/OPT:REF", "/OPT:ICF") } else { @() };
@@ -3270,6 +3278,11 @@ if (-not $IsCrossCompiling) {
32703278
Build-Compilers $HostArch @Tests
32713279
}
32723280

3281+
if ($Test -contains "android") {
3282+
Build-Runtime Android $AndroidX64 -Test
3283+
Build-Runtime Android $AndroidARM64 -Test
3284+
}
3285+
32733286
if ($Test -contains "dispatch") {
32743287
Build-Dispatch Windows $HostArch -Test
32753288
}

0 commit comments

Comments
 (0)