Skip to content

Commit ec5e9e6

Browse files
Run non-executable Swift Runtime tests for x86_64 Android
1 parent 8c5b49e commit ec5e9e6

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

test/lit.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,9 +1891,11 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
18911891
config.target_pic_opt = "-fPIC"
18921892

18931893
ndk_platform_tuple = get_architecture_value(armv7="armeabi-v7a",
1894-
aarch64="arm64-v8a")
1894+
aarch64="arm64-v8a",
1895+
x86_64="x86_64")
18951896
ndk_platform_triple = get_architecture_value(armv7="arm-linux-androideabi",
1896-
aarch64="aarch64-linux-android")
1897+
aarch64="aarch64-linux-android",
1898+
x86_64="x86_64-linux-android")
18971899
if platform.system() == 'Linux':
18981900
prebuilt_directory = 'linux-x86_64'
18991901
elif platform.system() == 'Darwin':

utils/build.ps1

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

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

210210
# Architecture definitions
@@ -2005,17 +2005,22 @@ function Build-CURL([Platform]$Platform, $Arch) {
20052005
})
20062006
}
20072007

2008-
function Build-Runtime([Platform]$Platform, $Arch) {
2008+
function Build-Runtime([Platform]$Platform, $Arch, [switch]$Test = $false) {
2009+
$Targets = @("install")
20092010
$PlatformDefines = @{}
20102011
if ($Platform -eq "Android") {
20112012
$PlatformDefines += @{
20122013
LLVM_ENABLE_LIBCXX = "YES";
20132014
SWIFT_USE_LINKER = "lld";
2014-
SWIFT_INCLUDE_TESTS = "NO";
2015-
SWIFT_INCLUDE_TEST_BINARIES = "NO";
20162015
}
20172016
}
2018-
2017+
if ($Test) {
2018+
$Targets += @("check-swift-all-only_non_executable")
2019+
$PlatformDefines += @{
2020+
SWIFT_INCLUDE_TESTS = "YES";
2021+
SWIFT_BUILD_TEST_SUPPORT_MODULES = "YES";
2022+
}
2023+
}
20192024

20202025
Isolate-EnvVars {
20212026
$env:Path = "$(Get-CMarkBinaryCache $Arch)\src;$(Get-PinnedToolchainRuntime);${env:Path}"
@@ -2026,6 +2031,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
20262031
Get-HostProjectBinaryCache Compilers
20272032
}
20282033

2034+
$NativeToolsPath = Join-Path -Path $CompilersBinaryCache -ChildPath "bin"
20292035
Build-CMakeProject `
20302036
-Src $SourceCache\swift `
20312037
-Bin (Get-TargetProjectBinaryCache $Arch Runtime) `
@@ -2034,6 +2040,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
20342040
-Platform $Platform `
20352041
-CacheScript $SourceCache\swift\cmake\caches\Runtime-$Platform-$($Arch.LLVMName).cmake `
20362042
-UseBuiltCompilers C,CXX,Swift `
2043+
-BuildTargets $Targets `
20372044
-Defines ($PlatformDefines + @{
20382045
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Arch);
20392046
CMAKE_Swift_COMPILER_WORKS = "YES";
@@ -2047,7 +2054,8 @@ function Build-Runtime([Platform]$Platform, $Arch) {
20472054
SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING = "YES";
20482055
SWIFT_ENABLE_SYNCHRONIZATION = "YES";
20492056
SWIFT_ENABLE_VOLATILE = "YES";
2050-
SWIFT_NATIVE_SWIFT_TOOLS_PATH = (Join-Path -Path $CompilersBinaryCache -ChildPath "bin");
2057+
SWIFT_NATIVE_LLVM_TOOLS_PATH = $NativeToolsPath;
2058+
SWIFT_NATIVE_SWIFT_TOOLS_PATH = $NativeToolsPath;
20512059
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = "$SourceCache\swift-corelibs-libdispatch";
20522060
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = "$SourceCache\swift-experimental-string-processing";
20532061
CMAKE_SHARED_LINKER_FLAGS = if ($Platform -eq "Windows") { @("/INCREMENTAL:NO", "/OPT:REF", "/OPT:ICF") } else { @() };
@@ -3222,6 +3230,11 @@ if (-not $IsCrossCompiling) {
32223230
Build-Compilers $HostArch @Tests
32233231
}
32243232

3233+
if ($Test -contains "android") {
3234+
Build-Runtime Android $AndroidX64 -Test
3235+
Build-Runtime Android $AndroidARM64 -Test
3236+
}
3237+
32253238
if ($Test -contains "dispatch") {
32263239
Build-Dispatch Windows $HostArch -Test
32273240
}

0 commit comments

Comments
 (0)