Skip to content

Commit 2eb73b9

Browse files
committed
Rename SPMTestSupport to InternalTestSupport
There's no such product or entity as "SPM", this contraction is just as invalid as "MOS" would be for macOS, or "SNIO" for SwiftNIO. All marketing and documentation materials consistently refer to it as "SwiftPM", and we should stay consistent in our codebase too. This also simplifies code search, as anything named as "SPM" almost never shows up in results when searching globally for "SwiftPM". We're not using `SwiftPMTestSupport` name here, as it might mislead contributors into thinking this module is somehow related to the `swift test` command. This module is purely internal, used only in modules with unit tests for SwiftPM itself, and is not supposed to be used by any packages depending on SwiftPM. Thus all `@_spi` declarations in it were also changed to `package`.
1 parent e16b997 commit 2eb73b9

File tree

149 files changed

+165
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+165
-177
lines changed

Package.swift

+25-25
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ let package = Package(
590590

591591
.target(
592592
/** SwiftPM test support library */
593-
name: "SPMTestSupport",
593+
name: "InternalTestSupport",
594594
dependencies: [
595595
"Basics",
596596
"Build",
@@ -618,13 +618,13 @@ let package = Package(
618618
name: "SourceKitLSPAPITests",
619619
dependencies: [
620620
"SourceKitLSPAPI",
621-
"SPMTestSupport",
621+
"InternalTestSupport",
622622
]
623623
),
624624

625625
.testTarget(
626626
name: "BasicsTests",
627-
dependencies: ["Basics", "SPMTestSupport", "tsan_utils"],
627+
dependencies: ["Basics", "InternalTestSupport", "tsan_utils"],
628628
exclude: [
629629
"Archiver/Inputs/archive.tar.gz",
630630
"Archiver/Inputs/archive.zip",
@@ -634,48 +634,48 @@ let package = Package(
634634
),
635635
.testTarget(
636636
name: "BuildTests",
637-
dependencies: ["Build", "PackageModel", "SPMTestSupport"]
637+
dependencies: ["Build", "PackageModel", "InternalTestSupport"]
638638
),
639639
.testTarget(
640640
name: "LLBuildManifestTests",
641-
dependencies: ["Basics", "LLBuildManifest", "SPMTestSupport"]
641+
dependencies: ["Basics", "LLBuildManifest", "InternalTestSupport"]
642642
),
643643
.testTarget(
644644
name: "WorkspaceTests",
645-
dependencies: ["Workspace", "SPMTestSupport"]
645+
dependencies: ["Workspace", "InternalTestSupport"]
646646
),
647647
.testTarget(
648648
name: "PackageDescriptionTests",
649649
dependencies: ["PackageDescription"]
650650
),
651651
.testTarget(
652652
name: "SPMBuildCoreTests",
653-
dependencies: ["SPMBuildCore", "SPMTestSupport"]
653+
dependencies: ["SPMBuildCore", "InternalTestSupport"]
654654
),
655655
.testTarget(
656656
name: "PackageLoadingTests",
657-
dependencies: ["PackageLoading", "SPMTestSupport"],
657+
dependencies: ["PackageLoading", "InternalTestSupport"],
658658
exclude: ["Inputs", "pkgconfigInputs"]
659659
),
660660
.testTarget(
661661
name: "PackageModelTests",
662-
dependencies: ["PackageModel", "SPMTestSupport"]
662+
dependencies: ["PackageModel", "InternalTestSupport"]
663663
),
664664
.testTarget(
665665
name: "PackageModelSyntaxTests",
666666
dependencies: [
667667
"PackageModelSyntax",
668-
"SPMTestSupport",
668+
"InternalTestSupport",
669669
.product(name: "SwiftIDEUtils", package: "swift-syntax"),
670670
]
671671
),
672672
.testTarget(
673673
name: "PackageGraphTests",
674-
dependencies: ["PackageGraph", "SPMTestSupport"]
674+
dependencies: ["PackageGraph", "InternalTestSupport"]
675675
),
676676
.testTarget(
677677
name: "PackageGraphPerformanceTests",
678-
dependencies: ["PackageGraph", "SPMTestSupport"],
678+
dependencies: ["PackageGraph", "InternalTestSupport"],
679679
exclude: [
680680
"Inputs/PerfectHTTPServer.json",
681681
"Inputs/ZewoHTTPServer.json",
@@ -685,44 +685,44 @@ let package = Package(
685685
),
686686
.testTarget(
687687
name: "PackageCollectionsModelTests",
688-
dependencies: ["PackageCollectionsModel", "SPMTestSupport"]
688+
dependencies: ["PackageCollectionsModel", "InternalTestSupport"]
689689
),
690690
.testTarget(
691691
name: "PackageCollectionsSigningTests",
692-
dependencies: ["PackageCollectionsSigning", "SPMTestSupport"]
692+
dependencies: ["PackageCollectionsSigning", "InternalTestSupport"]
693693
),
694694
.testTarget(
695695
name: "PackageCollectionsTests",
696-
dependencies: ["PackageCollections", "SPMTestSupport", "tsan_utils"]
696+
dependencies: ["PackageCollections", "InternalTestSupport", "tsan_utils"]
697697
),
698698
.testTarget(
699699
name: "PackageFingerprintTests",
700-
dependencies: ["PackageFingerprint", "SPMTestSupport"]
700+
dependencies: ["PackageFingerprint", "InternalTestSupport"]
701701
),
702702
.testTarget(
703703
name: "PackagePluginAPITests",
704-
dependencies: ["PackagePlugin", "SPMTestSupport"]
704+
dependencies: ["PackagePlugin", "InternalTestSupport"]
705705
),
706706
.testTarget(
707707
name: "PackageRegistryTests",
708-
dependencies: ["SPMTestSupport", "PackageRegistry"]
708+
dependencies: ["InternalTestSupport", "PackageRegistry"]
709709
),
710710
.testTarget(
711711
name: "PackageSigningTests",
712-
dependencies: ["SPMTestSupport", "PackageSigning"]
712+
dependencies: ["InternalTestSupport", "PackageSigning"]
713713
),
714714
.testTarget(
715715
name: "QueryEngineTests",
716-
dependencies: ["QueryEngine", "SPMTestSupport"]
716+
dependencies: ["QueryEngine", "InternalTestSupport"]
717717
),
718718
.testTarget(
719719
name: "SourceControlTests",
720-
dependencies: ["SourceControl", "SPMTestSupport"],
720+
dependencies: ["SourceControl", "InternalTestSupport"],
721721
exclude: ["Inputs/TestRepo.tgz"]
722722
),
723723
.testTarget(
724724
name: "XCBuildSupportTests",
725-
dependencies: ["XCBuildSupport", "SPMTestSupport"],
725+
dependencies: ["XCBuildSupport", "InternalTestSupport"],
726726
exclude: ["Inputs/Foo.pc"]
727727
),
728728
// Examples (These are built to ensure they stay up to date with the API.)
@@ -743,7 +743,7 @@ package.targets.append(contentsOf: [
743743
name: "FunctionalPerformanceTests",
744744
dependencies: [
745745
"swift-package-manager",
746-
"SPMTestSupport",
746+
"InternalTestSupport",
747747
]
748748
),
749749
])
@@ -757,7 +757,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] ==
757757
dependencies: [
758758
"swift-package-manager",
759759
"PackageModel",
760-
"SPMTestSupport",
760+
"InternalTestSupport",
761761
]
762762
),
763763

@@ -779,7 +779,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] ==
779779
"PackageModelSyntax",
780780
"PackageRegistryCommand",
781781
"SourceControl",
782-
"SPMTestSupport",
782+
"InternalTestSupport",
783783
"Workspace",
784784
"dummy-swiftc",
785785
]

Sources/SPMTestSupport/MockPackageGraphs.swift renamed to Sources/InternalTestSupport/MockPackageGraphs.swift

+6-12
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ import struct PackageModel.TargetDescription
2626
import protocol TSCBasic.FileSystem
2727
import class TSCBasic.InMemoryFileSystem
2828

29-
@_spi(SwiftPMInternal)
30-
public typealias MockPackageGraph = (
29+
package typealias MockPackageGraph = (
3130
graph: ModulesGraph,
3231
fileSystem: any FileSystem,
3332
observabilityScope: ObservabilityScope
3433
)
3534

36-
@_spi(SwiftPMInternal)
37-
public func macrosPackageGraph() throws -> MockPackageGraph {
35+
package func macrosPackageGraph() throws -> MockPackageGraph {
3836
let fs = InMemoryFileSystem(emptyFiles:
3937
"/swift-firmware/Sources/Core/source.swift",
4038
"/swift-firmware/Sources/HAL/source.swift",
@@ -132,8 +130,7 @@ public func macrosPackageGraph() throws -> MockPackageGraph {
132130
return (graph, fs, observability.topScope)
133131
}
134132

135-
@_spi(SwiftPMInternal)
136-
public func macrosTestsPackageGraph() throws -> MockPackageGraph {
133+
package func macrosTestsPackageGraph() throws -> MockPackageGraph {
137134
let fs = InMemoryFileSystem(emptyFiles:
138135
"/swift-mmio/Plugins/MMIOPlugin/source.swift",
139136
"/swift-mmio/Sources/MMIO/source.swift",
@@ -282,8 +279,7 @@ public func macrosTestsPackageGraph() throws -> MockPackageGraph {
282279
return (graph, fs, observability.topScope)
283280
}
284281

285-
@_spi(SwiftPMInternal)
286-
public func trivialPackageGraph() throws -> MockPackageGraph {
282+
package func trivialPackageGraph() throws -> MockPackageGraph {
287283
let fs = InMemoryFileSystem(
288284
emptyFiles:
289285
"/Pkg/Sources/app/main.swift",
@@ -313,8 +309,7 @@ public func trivialPackageGraph() throws -> MockPackageGraph {
313309
return (graph, fs, observability.topScope)
314310
}
315311

316-
@_spi(SwiftPMInternal)
317-
public func embeddedCxxInteropPackageGraph() throws -> MockPackageGraph {
312+
package func embeddedCxxInteropPackageGraph() throws -> MockPackageGraph {
318313
let fs = InMemoryFileSystem(
319314
emptyFiles:
320315
"/Pkg/Sources/app/main.swift",
@@ -356,8 +351,7 @@ public func embeddedCxxInteropPackageGraph() throws -> MockPackageGraph {
356351
return (graph, fs, observability.topScope)
357352
}
358353

359-
@_spi(SwiftPMInternal)
360-
public func toolsExplicitLibrariesGraph(linkage: ProductType.LibraryType) throws -> MockPackageGraph {
354+
package func toolsExplicitLibrariesGraph(linkage: ProductType.LibraryType) throws -> MockPackageGraph {
361355
let fs = InMemoryFileSystem(emptyFiles:
362356
"/swift-mmio/Sources/MMIOMacros/source.swift",
363357
"/swift-mmio/Sources/MMIOMacrosTests/source.swift",

Tests/BasicsTests/Archiver/TarArchiverTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Basics
1414
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
15-
import SPMTestSupport
15+
import InternalTestSupport
1616
import XCTest
1717

1818
import class TSCBasic.InMemoryFileSystem

Tests/BasicsTests/Archiver/UniversalArchiverTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Basics
1414
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
15-
import SPMTestSupport
15+
import InternalTestSupport
1616
import XCTest
1717

1818
import class TSCBasic.InMemoryFileSystem

Tests/BasicsTests/Archiver/ZipArchiverTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
1717

Tests/BasicsTests/AuthorizationProviderTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616

1717
final class AuthorizationProviderTests: XCTestCase {

Tests/BasicsTests/CancellatorTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616

1717
import class TSCBasic.Process

Tests/BasicsTests/HTTPClientTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616

1717
final class HTTPClientTests: XCTestCase {

Tests/BasicsTests/LegacyHTTPClientTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616

1717
final class LegacyHTTPClientTests: XCTestCase {

Tests/BasicsTests/ObservabilitySystemTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616

1717
// TODO: remove when transition to new diagnostics system is complete

Tests/BasicsTests/SQLiteBackedCacheTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import tsan_utils
1616
import XCTest
1717

Tests/BasicsTests/SandboxTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@testable import Basics
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616

1717
#if canImport(Darwin)

Tests/BasicsTests/URLSessionHTTPClientTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Foundation
1717
// need to decide how to best deal with that
1818
import FoundationNetworking
1919
#endif
20-
import SPMTestSupport
20+
import InternalTestSupport
2121
import XCTest
2222

2323
import struct TSCBasic.ByteString

Tests/BuildTests/BuildOperationTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import LLBuildManifest
1919
import PackageGraph
2020
import SPMBuildCore
2121
@_spi(SwiftPMInternal)
22-
import SPMTestSupport
22+
import InternalTestSupport
2323
import XCTest
2424

2525
import class TSCBasic.BufferedOutputByteStream

Tests/BuildTests/BuildPlanTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import PackageLoading
2626
@testable import PackageModel
2727

2828
import SPMBuildCore
29-
import SPMTestSupport
29+
import InternalTestSupport
3030
import SwiftDriver
3131
import Workspace
3232
import XCTest

Tests/BuildTests/BuildSystemDelegateTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import PackageModel
14-
import SPMTestSupport
14+
import InternalTestSupport
1515
import XCTest
1616

1717
import var TSCBasic.localFileSystem

Tests/BuildTests/ClangTargetBuildDescriptionTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Basics
1515
import PackageGraph
1616
import PackageModel
1717
import SPMBuildCore
18-
import SPMTestSupport
18+
import InternalTestSupport
1919
import XCTest
2020

2121
final class ClangTargetBuildDescriptionTests: XCTestCase {

Tests/BuildTests/CrossCompilationBuildPlanTests.swift

+13-18
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,19 @@ import class PackageModel.Manifest
2222
import struct PackageModel.TargetDescription
2323
import enum PackageModel.ProductType
2424
import struct SPMBuildCore.BuildParameters
25-
import func SPMTestSupport.loadPackageGraph
26-
27-
@_spi(SwiftPMInternal)
28-
import func SPMTestSupport.embeddedCxxInteropPackageGraph
29-
30-
@_spi(SwiftPMInternal)
31-
import func SPMTestSupport.macrosPackageGraph
32-
import func SPMTestSupport.macrosTestsPackageGraph
33-
import func SPMTestSupport.mockBuildParameters
34-
import func SPMTestSupport.mockBuildPlan
35-
import func SPMTestSupport.toolsExplicitLibrariesGraph
36-
37-
@_spi(SwiftPMInternal)
38-
import func SPMTestSupport.trivialPackageGraph
39-
40-
import struct SPMTestSupport.BuildPlanResult
41-
import func SPMTestSupport.XCTAssertMatch
42-
import func SPMTestSupport.XCTAssertNoDiagnostics
25+
import func InternalTestSupport.loadPackageGraph
26+
27+
import func InternalTestSupport.embeddedCxxInteropPackageGraph
28+
import func InternalTestSupport.macrosPackageGraph
29+
import func InternalTestSupport.macrosTestsPackageGraph
30+
import func InternalTestSupport.mockBuildParameters
31+
import func InternalTestSupport.mockBuildPlan
32+
import func InternalTestSupport.toolsExplicitLibrariesGraph
33+
import func InternalTestSupport.trivialPackageGraph
34+
35+
import struct InternalTestSupport.BuildPlanResult
36+
import func InternalTestSupport.XCTAssertMatch
37+
import func InternalTestSupport.XCTAssertNoDiagnostics
4338
import class TSCBasic.InMemoryFileSystem
4439

4540
import XCTest

0 commit comments

Comments
 (0)