Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* @aciidgh @jakepetroules @mhrawdon @neonichu @owenv @rjmansfield
*XCStrings* @matthewseaman @kulpreetchilana @jakepetroules @mhrawdon @neonichu @owenv @rjmansfield
*StringCatalog* @matthewseaman @kulpreetchilana @jakepetroules @mhrawdon @neonichu @owenv @rjmansfield
*Preview* @jonathanpenn @jakepetroules @mhrawdon @neonichu @owenv @rjmansfield
* @cmcgee1024 @daveinglis @jakepetroules @mhrawdon @owenv @rconnell9 @rjmansfield
*XCStrings* @matthewseaman @kulpreetchilana @cmcgee1024 @daveinglis @jakepetroules @mhrawdon @owenv @rconnell9 @rjmansfield
*StringCatalog* @matthewseaman @kulpreetchilana @cmcgee1024 @daveinglis @jakepetroules @mhrawdon @owenv @rconnell9 @rjmansfield
*Preview* @jonathanpenn @cmcgee1024 @daveinglis @jakepetroules @mhrawdon @owenv @rconnell9 @rjmansfield
1 change: 1 addition & 0 deletions Sources/SWBProjectModel/PIFGenerationModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ public enum PIF {
public var SUPPORTS_MACCATALYST: String?
public var SUPPORTS_TEXT_BASED_API: String?
public var SUPPRESS_WARNINGS: String?
public var SWIFT_TREAT_WARNINGS_AS_ERRORS: String?
public var SWIFT_ACTIVE_COMPILATION_CONDITIONS: [String]?
public var SWIFT_ADD_TOOLCHAIN_SWIFTSYNTAX_SEARCH_PATHS: String?
public var SWIFT_FORCE_STATIC_LINK_STDLIB: String?
Expand Down
7 changes: 7 additions & 0 deletions Sources/SWBTestSupport/SkippedTestSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ extension Trait where Self == Testing.ConditionTrait {
}
}

/// Skips a test case that requires one or more platforms to be loaded and available.
package static func requirePlatform(_ platform: String, comment: Comment? = nil) -> Self {
enabled(comment != nil ? "required platform is not available: \(comment?.description ?? "")" : "required platform is not available") { core in
return core.platformRegistry.lookup(name: platform) != nil
}
}

/// Skips a test case that requires a Swift SDK whose artifact bundle identifier suffix matches the given pattern.
///
/// Swift SDK artifact bundle identifiers follow the pattern `<compilerTag>_<suffix>`. This trait finds all installed
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftBuild/ProjectModel/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ extension ProjectModel {
case STRIP_INSTALLED_PRODUCT
case SUPPORTS_TEXT_BASED_API
case SUPPRESS_WARNINGS
case SWIFT_TREAT_WARNINGS_AS_ERRORS
case SWIFT_COMPILE_FOR_STATIC_LINKING
case SWIFT_DISABLE_PARSE_AS_LIBRARY
case SWIFT_ENABLE_BARE_SLASH_REGEX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import SWBMacro

@Suite
fileprivate struct AndroidTaskConstructionTests: CoreBasedTests {
@Test(.requireSDKs(.host), .enabled("No Android NDK is installed at any of the standard locations", { try await AndroidPlugin().effectiveInstallation(host: ProcessInfo.processInfo.hostOperatingSystem())?.ndk != nil }), arguments: ["aarch64", "x86_64"])
@Test(.requireSDKs(.host), .requirePlatform("android"), .enabled("No Android NDK is installed at any of the standard locations", { try await AndroidPlugin().effectiveInstallation(host: ProcessInfo.processInfo.hostOperatingSystem())?.ndk != nil }), arguments: ["aarch64", "x86_64"])
func androidSwiftSDKRunDestination(architecture: String) async throws {
// FIXME: Switch to Test.cancel once we are on Swift 6.3.
let ndk = try #require(try await AndroidPlugin().effectiveInstallation(host: ProcessInfo.processInfo.hostOperatingSystem())?.ndk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Foundation

@Suite
fileprivate struct GenericUnixSwiftSDKTaskConstructionTests: CoreBasedTests {
@Test(.requireSDKs(.host), arguments: ["aarch64", "x86_64"])
@Test(.requireSDKs(.host), .requirePlatform("linux"), arguments: ["aarch64", "x86_64"])
func staticLinuxSwiftSDKRunDestination(architecture: String) async throws {
try await withTemporaryDirectory { tmpDir in
let clangCompilerPath = try await self.clangCompilerPath
Expand Down Expand Up @@ -139,7 +139,7 @@ fileprivate struct GenericUnixSwiftSDKTaskConstructionTests: CoreBasedTests {
}
}

@Test(.requireSDKs(.host))
@Test(.requireSDKs(.host), .requirePlatform("linux"))
func inMemoryStaticLinuxSwiftSDKRunDestination() async throws {
try await withTemporaryDirectory { tmpDir in
let clangCompilerPath = try await self.clangCompilerPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fileprivate struct HostBuildToolTaskConstructionTests: CoreBasedTests {
}
}

@Test(.requireSDKs(.macOS), .requireXcode26())
@Test(.requireSDKs(.macOS), .requireXcode26(), .requirePlatform("linux"))
func hostToolBuildsForHostPlatformWithSwiftSDK() async throws {
try await withTemporaryDirectory { tmpDir in
let swiftCompilerPath = try await self.swiftCompilerPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SWBTestSupport

@Suite
fileprivate struct ToolsetTaskConstructionTests: CoreBasedTests {
@Test(.requireSDKs(.host))
@Test(.requireSDKs(.host), .requirePlatform("linux"))
func staticResourceDirectorySelection_toolsetImposesStaticStdlib() async throws {
try await withTemporaryDirectory { tmpDir in
let sdkManifestDir = tmpDir.join("TestSDK.artifactbundle")
Expand Down Expand Up @@ -143,7 +143,7 @@ fileprivate struct ToolsetTaskConstructionTests: CoreBasedTests {
}
}

@Test(.requireSDKs(.host))
@Test(.requireSDKs(.host), .requirePlatform("linux"))
func staticResourceDirectorySelection_requestImposesStaticStdlib() async throws {
try await withTemporaryDirectory { tmpDir in
let sdkManifestDir = tmpDir.join("TestSDK.artifactbundle")
Expand Down Expand Up @@ -265,7 +265,7 @@ fileprivate struct ToolsetTaskConstructionTests: CoreBasedTests {
}
}

@Test(.requireSDKs(.host))
@Test(.requireSDKs(.host), .requirePlatform("linux"))
func dynamicResourceDirectorySelection() async throws {
try await withTemporaryDirectory { tmpDir in
let sdkManifestDir = tmpDir.join("TestSDK.artifactbundle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SWBUtil

@Suite
fileprivate struct SWBWebAssemblyPlatformTests: CoreBasedTests {
@Test(.requireSDKs(.host))
@Test(.requireSDKs(.host), .requirePlatform("webassembly"))
func wasmSwiftSDKRunDestination() async throws {
try await withTemporaryDirectory { tmpDir in
let clangCompilerPath = try await self.clangCompilerPath
Expand Down
Loading