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
19 changes: 0 additions & 19 deletions IntegrationTests/Tests/IntegrationTests/BasicTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ final class BasicTests: XCTestCase {

func testExamplePackageDealer() throws {
try XCTSkipIf(isSelfHosted, "These packages don't use the latest runtime library, which doesn't work with self-hosted builds.")
try skipUnlessAtLeastSwift6()

try withTemporaryDirectory { tempDir in
let packagePath = tempDir.appending(component: "dealer")
Expand Down Expand Up @@ -94,8 +93,6 @@ final class BasicTests: XCTestCase {
}

func testSwiftPackageInitExec() throws {
try skipUnlessAtLeastSwift6()

try withTemporaryDirectory { tempDir in
// Create a new package with an executable target.
let packagePath = tempDir.appending(component: "Project")
Expand All @@ -121,8 +118,6 @@ final class BasicTests: XCTestCase {
}

func testSwiftPackageInitExecTests() throws {
try skipUnlessAtLeastSwift6()

try XCTSkip("FIXME: swift-test invocations are timing out in Xcode and self-hosted CI")

try withTemporaryDirectory { tempDir in
Expand All @@ -146,8 +141,6 @@ final class BasicTests: XCTestCase {
}

func testSwiftPackageInitLib() throws {
try skipUnlessAtLeastSwift6()

try withTemporaryDirectory { tempDir in
// Create a new package with an executable target.
let packagePath = tempDir.appending(component: "Project")
Expand All @@ -166,8 +159,6 @@ final class BasicTests: XCTestCase {
}

func testSwiftPackageLibsTests() throws {
try skipUnlessAtLeastSwift6()

try XCTSkip("FIXME: swift-test invocations are timing out in Xcode and self-hosted CI")

try withTemporaryDirectory { tempDir in
Expand Down Expand Up @@ -226,8 +217,6 @@ final class BasicTests: XCTestCase {
}

func testSwiftRun() throws {
try skipUnlessAtLeastSwift6()

try withTemporaryDirectory { tempDir in
let packagePath = tempDir.appending(component: "secho")
try localFileSystem.createDirectory(packagePath)
Expand Down Expand Up @@ -255,8 +244,6 @@ final class BasicTests: XCTestCase {
}

func testSwiftTest() throws {
try skipUnlessAtLeastSwift6()

try XCTSkip("FIXME: swift-test invocations are timing out in Xcode and self-hosted CI")

try withTemporaryDirectory { tempDir in
Expand Down Expand Up @@ -378,9 +365,3 @@ private extension Character {
}
}
}

private func skipUnlessAtLeastSwift6() throws {
#if compiler(<6.0)
try XCTSkipIf(true, "Skipping because test requires at least Swift 6.0")
#endif
}
4 changes: 0 additions & 4 deletions Sources/Basics/OSSignpost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
//===----------------------------------------------------------------------===//

#if canImport(os)
#if compiler(>=6.0)
import os
#else
@preconcurrency import os
#endif

extension os.OSLog {
@usableFromInline
Expand Down
5 changes: 0 additions & 5 deletions Sources/Build/LLBuildCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ final class TestEntryPointCommand: CustomLLBuildCommand, TestBuildCommand {
if buildParameters.triple.isLinux() {
// FIXME: work around crash on Amazon Linux 2 when main function is async (rdar://128303921)
needsAsyncMainWorkaround = true
} else if buildParameters.triple.isDarwin() {
#if compiler(<5.10)
// FIXME: work around duplicate async_Main symbols (SEE https://github.com/swiftlang/swift/pull/69113)
needsAsyncMainWorkaround = true
#endif
}

stream.send(
Expand Down
4 changes: 0 additions & 4 deletions Sources/Commands/PackageCommands/Init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,4 @@ extension SwiftPackageCommand {
}
}

#if compiler(<6.0)
extension InitPackage.PackageType: ExpressibleByArgument {}
#else
extension InitPackage.PackageType: @retroactive ExpressibleByArgument {}
#endif
4 changes: 0 additions & 4 deletions Sources/Commands/Utilities/APIDigester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,4 @@ extension SerializedDiagnostics.SourceLocation {
}
}

#if compiler(<6.0)
extension SerializedDiagnostics.SourceLocation: DiagnosticLocation {}
#else
extension SerializedDiagnostics.SourceLocation: @retroactive DiagnosticLocation {}
#endif
11 changes: 0 additions & 11 deletions Sources/CoreCommands/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -774,16 +774,6 @@ extension URL {
}
}

#if compiler(<6.0)
extension BuildConfiguration: ExpressibleByArgument, CaseIterable {}
extension AbsolutePath: ExpressibleByArgument {}
extension WorkspaceConfiguration.CheckingMode: ExpressibleByArgument {}
extension Sanitizer: ExpressibleByArgument {}
extension BuildSystemProvider.Kind: ExpressibleByArgument, CaseIterable {}
extension Version: ExpressibleByArgument {}
extension PackageIdentity: ExpressibleByArgument {}
extension URL: ExpressibleByArgument {}
#else
extension BuildConfiguration: @retroactive ExpressibleByArgument, CaseIterable {}
extension AbsolutePath: @retroactive ExpressibleByArgument {}
extension WorkspaceConfiguration.CheckingMode: @retroactive ExpressibleByArgument {}
Expand All @@ -792,4 +782,3 @@ extension BuildSystemProvider.Kind: @retroactive ExpressibleByArgument, CaseIter
extension Version: @retroactive ExpressibleByArgument {}
extension PackageIdentity: @retroactive ExpressibleByArgument {}
extension URL: @retroactive ExpressibleByArgument {}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,7 @@ extension SignatureFormat {
}
}

#if compiler(<6.0)
extension SignatureFormat: ExpressibleByArgument {}
#else
extension SignatureFormat: @retroactive ExpressibleByArgument {}
#endif

enum MetadataLocation {
case sourceTree(AbsolutePath)
Expand Down
4 changes: 0 additions & 4 deletions Sources/Workspace/Diagnostics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,4 @@ extension FileSystemError {
}
}

#if compiler(<6.0)
extension FileSystemError: CustomStringConvertible {}
#else
extension FileSystemError: @retroactive CustomStringConvertible {}
#endif
4 changes: 0 additions & 4 deletions Sources/Workspace/Workspace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1519,11 +1519,7 @@ private func warnToStderr(_ message: String) {
}

// used for manifest validation
#if compiler(<6.0)
extension RepositoryManager: ManifestSourceControlValidator {}
#else
extension RepositoryManager: @retroactive ManifestSourceControlValidator {}
#endif

extension ContainerUpdateStrategy {
var repositoryUpdateStrategy: RepositoryUpdateStrategy {
Expand Down
29 changes: 0 additions & 29 deletions Sources/_InternalTestSupport/XCTSkipHelpers.swift

This file was deleted.

11 changes: 0 additions & 11 deletions Sources/_InternalTestSupport/misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -515,16 +515,6 @@ extension InitPackage {
}
}

#if compiler(<6.0)
extension RelativePath: ExpressibleByStringLiteral {}
extension RelativePath: ExpressibleByStringInterpolation {}
extension URL: ExpressibleByStringLiteral {}
extension URL: ExpressibleByStringInterpolation {}
extension PackageIdentity: ExpressibleByStringLiteral {}
extension PackageIdentity: ExpressibleByStringInterpolation {}
extension AbsolutePath: ExpressibleByStringLiteral {}
extension AbsolutePath: ExpressibleByStringInterpolation {}
#else
extension RelativePath: @retroactive ExpressibleByStringLiteral {}
extension RelativePath: @retroactive ExpressibleByStringInterpolation {}
extension URL: @retroactive ExpressibleByStringLiteral {}
Expand All @@ -533,7 +523,6 @@ extension PackageIdentity: @retroactive ExpressibleByStringLiteral {}
extension PackageIdentity: @retroactive ExpressibleByStringInterpolation {}
extension AbsolutePath: @retroactive ExpressibleByStringLiteral {}
extension AbsolutePath: @retroactive ExpressibleByStringInterpolation {}
#endif

public func getNumberOfMatches(of match: String, in value: String) -> Int {
guard match.count != 0 else { return 0 }
Expand Down
6 changes: 0 additions & 6 deletions Sources/swift-bootstrap/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,9 @@ extension BuildConfiguration {
}
}

#if compiler(<6.0)
extension AbsolutePath: ExpressibleByArgument {}
extension BuildConfiguration: ExpressibleByArgument, CaseIterable {}
extension BuildSystemProvider.Kind: ExpressibleByArgument, CaseIterable {}
#else
extension AbsolutePath: @retroactive ExpressibleByArgument {}
extension BuildConfiguration: @retroactive ExpressibleByArgument, CaseIterable {}
extension BuildSystemProvider.Kind: @retroactive ExpressibleByArgument, CaseIterable {}
#endif

public func topologicalSort<T: Hashable>(
_ nodes: [T], successors: (T) async throws -> [T]
Expand Down
4 changes: 0 additions & 4 deletions Sources/swiftpm-testing-helper/Entrypoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ struct Entrypoint {
let bundlePath = args[2]
guard let image = dlopen(bundlePath, RTLD_LAZY | RTLD_FIRST) else {
let errorMessage: String = dlerror().flatMap {
#if compiler(>=6)
String(validatingCString: $0)
#else
String(validatingUTF8: $0)
#endif
} ?? "An unknown error occurred."
fatalError("Failed to open test bundle at path \(bundlePath): \(errorMessage)")
}
Expand Down
1 change: 0 additions & 1 deletion Tests/BuildTests/BuildSystemDelegateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import var TSCBasic.localFileSystem

final class BuildSystemDelegateTests: XCTestCase {
func testDoNotFilterLinkerDiagnostics() async throws {
try UserToolchain.default.skipUnlessAtLeastSwift6()
try XCTSkipIf(!UserToolchain.default.supportsSDKDependentTests(), "skipping because test environment doesn't support this test")
try await fixture(name: "Miscellaneous/DoNotFilterLinkerDiagnostics") { fixturePath in
#if !os(macOS)
Expand Down
5 changes: 0 additions & 5 deletions Tests/CommandsTests/APIDiffTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ final class APIDiffTests: CommandsTestCase {
guard (try? UserToolchain.default.getSwiftAPIDigester()) != nil else {
throw XCTSkip("swift-api-digester unavailable")
}
// The tests rely on swift-api-digester post-5.5 version and are certain
// to work with Swift compiler v6.0 and later.
#if compiler(<6.0)
throw XCTSkip("Skipping because test requires at least Swift compiler v6.0")
#endif
}

func testInvokeAPIDiffDigester() async throws {
Expand Down
6 changes: 0 additions & 6 deletions Tests/CommandsTests/BuildCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -721,13 +721,7 @@ final class BuildCommandTests: CommandsTestCase {
}

func testFatalErrorDisplayedCorrectNumberOfTimesWhenSingleXCTestHasFatalErrorInBuildCompilation() async throws {
// Test for GitHub Issue #6605
// GIVEN we have a Swift Package that has a fatalError building the tests
#if compiler(>=6)
let expected = 0
#else
let expected = 1
#endif
try await fixture(name: "Miscellaneous/Errors/FatalErrorInSingleXCTest/TypeLibrary") { fixturePath in
// WHEN swift-build --build-tests is executed"
await XCTAssertAsyncThrowsError(try await self.execute(["--build-tests"], packagePath: fixturePath)) { error in
Expand Down
20 changes: 0 additions & 20 deletions Tests/CommandsTests/TestCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,12 @@ final class TestCommandTests: CommandsTestCase {
}

func testSwiftTestXMLOutputVerifySingleTestFailureMessageWithFlagEnabledSwiftTesting() async throws {
#if compiler(<6)
_ = XCTSkip("Swift Testing is not available by default in this Swift compiler version")
#else
try await self._testSwiftTestXMLOutputFailureMessage(
fixtureName: "Miscellaneous/TestSingleFailureSwiftTesting",
testRunner: .SwiftTesting,
enableExperimentalFlag: true,
matchesPattern: [.contains("Purposely failing &amp; validating XML espace &quot;'&lt;&gt;")]
)
#endif
}
func testSwiftTestXMLOutputVerifySingleTestFailureMessageWithFlagDisabledXCTest() async throws {
try await self._testSwiftTestXMLOutputFailureMessage(
Expand All @@ -276,16 +272,12 @@ final class TestCommandTests: CommandsTestCase {
}

func testSwiftTestXMLOutputVerifySingleTestFailureMessageWithFlagDisabledSwiftTesting() async throws {
#if compiler(<6)
_ = XCTSkip("Swift Testing is not available by default in this Swift compiler version")
#else
try await self._testSwiftTestXMLOutputFailureMessage(
fixtureName: "Miscellaneous/TestSingleFailureSwiftTesting",
testRunner: .SwiftTesting,
enableExperimentalFlag: false,
matchesPattern: [.contains("Purposely failing &amp; validating XML espace &quot;'&lt;&gt;")]
)
#endif
}

func testSwiftTestXMLOutputVerifyMultipleTestFailureMessageWithFlagEnabledXCTest() async throws {
Expand All @@ -309,9 +301,6 @@ final class TestCommandTests: CommandsTestCase {
}

func testSwiftTestXMLOutputVerifyMultipleTestFailureMessageWithFlagEnabledSwiftTesting() async throws {
#if compiler(<6)
_ = XCTSkip("Swift Testing is not available by default in this Swift compiler version")
#else
try await self._testSwiftTestXMLOutputFailureMessage(
fixtureName: "Miscellaneous/TestMultipleFailureSwiftTesting",
testRunner: .SwiftTesting,
Expand All @@ -329,7 +318,6 @@ final class TestCommandTests: CommandsTestCase {
.contains("ST Test failure 10")
]
)
#endif
}

func testSwiftTestXMLOutputVerifyMultipleTestFailureMessageWithFlagDisabledXCTest() async throws {
Expand All @@ -353,9 +341,6 @@ final class TestCommandTests: CommandsTestCase {
}

func testSwiftTestXMLOutputVerifyMultipleTestFailureMessageWithFlagDisabledSwiftTesting() async throws {
#if compiler(<6)
_ = XCTSkip("Swift Testing is not available by default in this Swift compiler version")
#else
try await self._testSwiftTestXMLOutputFailureMessage(
fixtureName: "Miscellaneous/TestMultipleFailureSwiftTesting",
testRunner: .SwiftTesting,
Expand All @@ -373,7 +358,6 @@ final class TestCommandTests: CommandsTestCase {
.contains("ST Test failure 10")
]
)
#endif
}

func testSwiftTestFilter() async throws {
Expand Down Expand Up @@ -585,11 +569,7 @@ final class TestCommandTests: CommandsTestCase {
func testFatalErrorDisplayedCorrectNumberOfTimesWhenSingleXCTestHasFatalErrorInBuildCompilation() async throws {
// Test for GitHub Issue #6605
// GIVEN we have a Swift Package that has a fatalError building the tests
#if compiler(>=6)
let expected = 1
#else
let expected = 2
#endif
try await fixture(name: "Miscellaneous/Errors/FatalErrorInSingleXCTest/TypeLibrary") { fixturePath in
// WHEN swift-test is executed
await XCTAssertAsyncThrowsError(try await self.execute([], packagePath: fixturePath)) { error in
Expand Down
3 changes: 0 additions & 3 deletions Tests/FunctionalTests/MiscellaneousTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,6 @@ final class MiscellaneousTestCase: XCTestCase {

@available(macOS 15, *)
func testTestsCanLinkAgainstAsyncExecutable() async throws {
#if compiler(<5.10)
try XCTSkipIf(true, "skipping because host compiler doesn't have a fix for symbol conflicts yet")
#endif
try await fixture(name: "Miscellaneous/TestableAsyncExe") { fixturePath in
let (stdout, stderr) = try await executeSwiftTest(fixturePath)
// in "swift test" build output goes to stderr
Expand Down
Loading