Skip to content

[NFC] Rename SPMTestSupport to _InternalTestSupport #7676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 27, 2024
52 changes: 26 additions & 26 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ let package = Package(
// MARK: Additional Test Dependencies

.target(
/** SwiftPM test support library */
name: "SPMTestSupport",
/** SwiftPM internal test suite support library */
name: "_InternalTestSupport",
dependencies: [
"Basics",
"Build",
Expand Down Expand Up @@ -618,13 +618,13 @@ let package = Package(
name: "SourceKitLSPAPITests",
dependencies: [
"SourceKitLSPAPI",
"SPMTestSupport",
"_InternalTestSupport",
]
),

.testTarget(
name: "BasicsTests",
dependencies: ["Basics", "SPMTestSupport", "tsan_utils"],
dependencies: ["Basics", "_InternalTestSupport", "tsan_utils"],
exclude: [
"Archiver/Inputs/archive.tar.gz",
"Archiver/Inputs/archive.zip",
Expand All @@ -634,48 +634,48 @@ let package = Package(
),
.testTarget(
name: "BuildTests",
dependencies: ["Build", "PackageModel", "SPMTestSupport"]
dependencies: ["Build", "PackageModel", "_InternalTestSupport"]
),
.testTarget(
name: "LLBuildManifestTests",
dependencies: ["Basics", "LLBuildManifest", "SPMTestSupport"]
dependencies: ["Basics", "LLBuildManifest", "_InternalTestSupport"]
),
.testTarget(
name: "WorkspaceTests",
dependencies: ["Workspace", "SPMTestSupport"]
dependencies: ["Workspace", "_InternalTestSupport"]
),
.testTarget(
name: "PackageDescriptionTests",
dependencies: ["PackageDescription"]
),
.testTarget(
name: "SPMBuildCoreTests",
dependencies: ["SPMBuildCore", "SPMTestSupport"]
dependencies: ["SPMBuildCore", "_InternalTestSupport"]
),
.testTarget(
name: "PackageLoadingTests",
dependencies: ["PackageLoading", "SPMTestSupport"],
dependencies: ["PackageLoading", "_InternalTestSupport"],
exclude: ["Inputs", "pkgconfigInputs"]
),
.testTarget(
name: "PackageModelTests",
dependencies: ["PackageModel", "SPMTestSupport"]
dependencies: ["PackageModel", "_InternalTestSupport"]
),
.testTarget(
name: "PackageModelSyntaxTests",
dependencies: [
"PackageModelSyntax",
"SPMTestSupport",
"_InternalTestSupport",
.product(name: "SwiftIDEUtils", package: "swift-syntax"),
]
),
.testTarget(
name: "PackageGraphTests",
dependencies: ["PackageGraph", "SPMTestSupport"]
dependencies: ["PackageGraph", "_InternalTestSupport"]
),
.testTarget(
name: "PackageGraphPerformanceTests",
dependencies: ["PackageGraph", "SPMTestSupport"],
dependencies: ["PackageGraph", "_InternalTestSupport"],
exclude: [
"Inputs/PerfectHTTPServer.json",
"Inputs/ZewoHTTPServer.json",
Expand All @@ -685,44 +685,44 @@ let package = Package(
),
.testTarget(
name: "PackageCollectionsModelTests",
dependencies: ["PackageCollectionsModel", "SPMTestSupport"]
dependencies: ["PackageCollectionsModel", "_InternalTestSupport"]
),
.testTarget(
name: "PackageCollectionsSigningTests",
dependencies: ["PackageCollectionsSigning", "SPMTestSupport"]
dependencies: ["PackageCollectionsSigning", "_InternalTestSupport"]
),
.testTarget(
name: "PackageCollectionsTests",
dependencies: ["PackageCollections", "SPMTestSupport", "tsan_utils"]
dependencies: ["PackageCollections", "_InternalTestSupport", "tsan_utils"]
),
.testTarget(
name: "PackageFingerprintTests",
dependencies: ["PackageFingerprint", "SPMTestSupport"]
dependencies: ["PackageFingerprint", "_InternalTestSupport"]
),
.testTarget(
name: "PackagePluginAPITests",
dependencies: ["PackagePlugin", "SPMTestSupport"]
dependencies: ["PackagePlugin", "_InternalTestSupport"]
),
.testTarget(
name: "PackageRegistryTests",
dependencies: ["SPMTestSupport", "PackageRegistry"]
dependencies: ["_InternalTestSupport", "PackageRegistry"]
),
.testTarget(
name: "PackageSigningTests",
dependencies: ["SPMTestSupport", "PackageSigning"]
dependencies: ["_InternalTestSupport", "PackageSigning"]
),
.testTarget(
name: "QueryEngineTests",
dependencies: ["QueryEngine", "SPMTestSupport"]
dependencies: ["QueryEngine", "_InternalTestSupport"]
),
.testTarget(
name: "SourceControlTests",
dependencies: ["SourceControl", "SPMTestSupport"],
dependencies: ["SourceControl", "_InternalTestSupport"],
exclude: ["Inputs/TestRepo.tgz"]
),
.testTarget(
name: "XCBuildSupportTests",
dependencies: ["XCBuildSupport", "SPMTestSupport"],
dependencies: ["XCBuildSupport", "_InternalTestSupport"],
exclude: ["Inputs/Foo.pc"]
),
// Examples (These are built to ensure they stay up to date with the API.)
Expand All @@ -743,7 +743,7 @@ package.targets.append(contentsOf: [
name: "FunctionalPerformanceTests",
dependencies: [
"swift-package-manager",
"SPMTestSupport",
"_InternalTestSupport",
]
),
])
Expand All @@ -757,7 +757,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] ==
dependencies: [
"swift-package-manager",
"PackageModel",
"SPMTestSupport",
"_InternalTestSupport",
]
),

Expand All @@ -779,7 +779,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] ==
"PackageModelSyntax",
"PackageRegistryCommand",
"SourceControl",
"SPMTestSupport",
"_InternalTestSupport",
"Workspace",
"dummy-swiftc",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ import struct PackageModel.TargetDescription
import protocol TSCBasic.FileSystem
import class TSCBasic.InMemoryFileSystem

@_spi(SwiftPMInternal)
public typealias MockPackageGraph = (
package typealias MockPackageGraph = (
graph: ModulesGraph,
fileSystem: any FileSystem,
observabilityScope: ObservabilityScope
)

@_spi(SwiftPMInternal)
public func macrosPackageGraph() throws -> MockPackageGraph {
package func macrosPackageGraph() throws -> MockPackageGraph {
let fs = InMemoryFileSystem(emptyFiles:
"/swift-firmware/Sources/Core/source.swift",
"/swift-firmware/Sources/HAL/source.swift",
Expand Down Expand Up @@ -132,8 +130,7 @@ public func macrosPackageGraph() throws -> MockPackageGraph {
return (graph, fs, observability.topScope)
}

@_spi(SwiftPMInternal)
public func macrosTestsPackageGraph() throws -> MockPackageGraph {
package func macrosTestsPackageGraph() throws -> MockPackageGraph {
let fs = InMemoryFileSystem(emptyFiles:
"/swift-mmio/Plugins/MMIOPlugin/source.swift",
"/swift-mmio/Sources/MMIO/source.swift",
Expand Down Expand Up @@ -282,8 +279,7 @@ public func macrosTestsPackageGraph() throws -> MockPackageGraph {
return (graph, fs, observability.topScope)
}

@_spi(SwiftPMInternal)
public func trivialPackageGraph() throws -> MockPackageGraph {
package func trivialPackageGraph() throws -> MockPackageGraph {
let fs = InMemoryFileSystem(
emptyFiles:
"/Pkg/Sources/app/main.swift",
Expand Down Expand Up @@ -313,8 +309,7 @@ public func trivialPackageGraph() throws -> MockPackageGraph {
return (graph, fs, observability.topScope)
}

@_spi(SwiftPMInternal)
public func embeddedCxxInteropPackageGraph() throws -> MockPackageGraph {
package func embeddedCxxInteropPackageGraph() throws -> MockPackageGraph {
let fs = InMemoryFileSystem(
emptyFiles:
"/Pkg/Sources/app/main.swift",
Expand Down Expand Up @@ -356,8 +351,7 @@ public func embeddedCxxInteropPackageGraph() throws -> MockPackageGraph {
return (graph, fs, observability.topScope)
}

@_spi(SwiftPMInternal)
public func toolsExplicitLibrariesGraph(linkage: ProductType.LibraryType) throws -> MockPackageGraph {
package func toolsExplicitLibrariesGraph(linkage: ProductType.LibraryType) throws -> MockPackageGraph {
let fs = InMemoryFileSystem(emptyFiles:
"/swift-mmio/Sources/MMIOMacros/source.swift",
"/swift-mmio/Sources/MMIOMacrosTests/source.swift",
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/Archiver/TarArchiverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Basics
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
import SPMTestSupport
import _InternalTestSupport
import XCTest

import class TSCBasic.InMemoryFileSystem
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/Archiver/UniversalArchiverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Basics
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
import SPMTestSupport
import _InternalTestSupport
import XCTest

import class TSCBasic.InMemoryFileSystem
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/Archiver/ZipArchiverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

import Basics
import SPMTestSupport
import _InternalTestSupport
import XCTest
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported

Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/AuthorizationProviderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

@testable import Basics
import SPMTestSupport
import _InternalTestSupport
import XCTest

final class AuthorizationProviderTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/CancellatorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

@testable import Basics
import SPMTestSupport
import _InternalTestSupport
import XCTest

import class TSCBasic.Process
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/HTTPClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

@testable import Basics
import SPMTestSupport
import _InternalTestSupport
import XCTest

final class HTTPClientTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/LegacyHTTPClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

@testable import Basics
import SPMTestSupport
import _InternalTestSupport
import XCTest

final class LegacyHTTPClientTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/ObservabilitySystemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

@testable import Basics
import SPMTestSupport
import _InternalTestSupport
import XCTest

// TODO: remove when transition to new diagnostics system is complete
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/SQLiteBackedCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

@testable import Basics
import SPMTestSupport
import _InternalTestSupport
import tsan_utils
import XCTest

Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/SandboxTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

@testable import Basics
import SPMTestSupport
import _InternalTestSupport
import XCTest

#if canImport(Darwin)
Expand Down
2 changes: 1 addition & 1 deletion Tests/BasicsTests/URLSessionHTTPClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Foundation
// need to decide how to best deal with that
import FoundationNetworking
#endif
import SPMTestSupport
import _InternalTestSupport
import XCTest

import struct TSCBasic.ByteString
Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/BuildOperationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import LLBuildManifest
import PackageGraph
import SPMBuildCore
@_spi(SwiftPMInternal)
import SPMTestSupport
import _InternalTestSupport
import XCTest

import class TSCBasic.BufferedOutputByteStream
Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/BuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import PackageLoading
@testable import PackageModel

import SPMBuildCore
import SPMTestSupport
import _InternalTestSupport
import SwiftDriver
import Workspace
import XCTest
Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/BuildSystemDelegateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

import PackageModel
import SPMTestSupport
import _InternalTestSupport
import XCTest

import var TSCBasic.localFileSystem
Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/ClangTargetBuildDescriptionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Basics
import PackageGraph
import PackageModel
import SPMBuildCore
import SPMTestSupport
import _InternalTestSupport
import XCTest

final class ClangTargetBuildDescriptionTests: XCTestCase {
Expand Down
31 changes: 13 additions & 18 deletions Tests/BuildTests/CrossCompilationBuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,19 @@ import class PackageModel.Manifest
import struct PackageModel.TargetDescription
import enum PackageModel.ProductType
import struct SPMBuildCore.BuildParameters
import func SPMTestSupport.loadPackageGraph

@_spi(SwiftPMInternal)
import func SPMTestSupport.embeddedCxxInteropPackageGraph

@_spi(SwiftPMInternal)
import func SPMTestSupport.macrosPackageGraph
import func SPMTestSupport.macrosTestsPackageGraph
import func SPMTestSupport.mockBuildParameters
import func SPMTestSupport.mockBuildPlan
import func SPMTestSupport.toolsExplicitLibrariesGraph

@_spi(SwiftPMInternal)
import func SPMTestSupport.trivialPackageGraph

import struct SPMTestSupport.BuildPlanResult
import func SPMTestSupport.XCTAssertMatch
import func SPMTestSupport.XCTAssertNoDiagnostics
import func _InternalTestSupport.loadPackageGraph

import func _InternalTestSupport.embeddedCxxInteropPackageGraph
import func _InternalTestSupport.macrosPackageGraph
import func _InternalTestSupport.macrosTestsPackageGraph
import func _InternalTestSupport.mockBuildParameters
import func _InternalTestSupport.mockBuildPlan
import func _InternalTestSupport.toolsExplicitLibrariesGraph
import func _InternalTestSupport.trivialPackageGraph

import struct _InternalTestSupport.BuildPlanResult
import func _InternalTestSupport.XCTAssertMatch
import func _InternalTestSupport.XCTAssertNoDiagnostics
import class TSCBasic.InMemoryFileSystem

import XCTest
Expand Down
Loading