Skip to content

Commit 33662ed

Browse files
authored
[NFC] Rename SPMTestSupport to _InternalTestSupport (#7676)
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 086cba7 commit 33662ed

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

+26-26
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,8 @@ let package = Package(
592592
// MARK: Additional Test Dependencies
593593

594594
.target(
595-
/** SwiftPM test support library */
596-
name: "SPMTestSupport",
595+
/** SwiftPM internal test suite support library */
596+
name: "_InternalTestSupport",
597597
dependencies: [
598598
"Basics",
599599
"Build",
@@ -621,13 +621,13 @@ let package = Package(
621621
name: "SourceKitLSPAPITests",
622622
dependencies: [
623623
"SourceKitLSPAPI",
624-
"SPMTestSupport",
624+
"_InternalTestSupport",
625625
]
626626
),
627627

628628
.testTarget(
629629
name: "BasicsTests",
630-
dependencies: ["Basics", "SPMTestSupport", "tsan_utils"],
630+
dependencies: ["Basics", "_InternalTestSupport", "tsan_utils"],
631631
exclude: [
632632
"Archiver/Inputs/archive.tar.gz",
633633
"Archiver/Inputs/archive.zip",
@@ -637,48 +637,48 @@ let package = Package(
637637
),
638638
.testTarget(
639639
name: "BuildTests",
640-
dependencies: ["Build", "PackageModel", "SPMTestSupport"]
640+
dependencies: ["Build", "PackageModel", "_InternalTestSupport"]
641641
),
642642
.testTarget(
643643
name: "LLBuildManifestTests",
644-
dependencies: ["Basics", "LLBuildManifest", "SPMTestSupport"]
644+
dependencies: ["Basics", "LLBuildManifest", "_InternalTestSupport"]
645645
),
646646
.testTarget(
647647
name: "WorkspaceTests",
648-
dependencies: ["Workspace", "SPMTestSupport"]
648+
dependencies: ["Workspace", "_InternalTestSupport"]
649649
),
650650
.testTarget(
651651
name: "PackageDescriptionTests",
652652
dependencies: ["PackageDescription"]
653653
),
654654
.testTarget(
655655
name: "SPMBuildCoreTests",
656-
dependencies: ["SPMBuildCore", "SPMTestSupport"]
656+
dependencies: ["SPMBuildCore", "_InternalTestSupport"]
657657
),
658658
.testTarget(
659659
name: "PackageLoadingTests",
660-
dependencies: ["PackageLoading", "SPMTestSupport"],
660+
dependencies: ["PackageLoading", "_InternalTestSupport"],
661661
exclude: ["Inputs", "pkgconfigInputs"]
662662
),
663663
.testTarget(
664664
name: "PackageModelTests",
665-
dependencies: ["PackageModel", "SPMTestSupport"]
665+
dependencies: ["PackageModel", "_InternalTestSupport"]
666666
),
667667
.testTarget(
668668
name: "PackageModelSyntaxTests",
669669
dependencies: [
670670
"PackageModelSyntax",
671-
"SPMTestSupport",
671+
"_InternalTestSupport",
672672
.product(name: "SwiftIDEUtils", package: "swift-syntax"),
673673
]
674674
),
675675
.testTarget(
676676
name: "PackageGraphTests",
677-
dependencies: ["PackageGraph", "SPMTestSupport"]
677+
dependencies: ["PackageGraph", "_InternalTestSupport"]
678678
),
679679
.testTarget(
680680
name: "PackageGraphPerformanceTests",
681-
dependencies: ["PackageGraph", "SPMTestSupport"],
681+
dependencies: ["PackageGraph", "_InternalTestSupport"],
682682
exclude: [
683683
"Inputs/PerfectHTTPServer.json",
684684
"Inputs/ZewoHTTPServer.json",
@@ -688,44 +688,44 @@ let package = Package(
688688
),
689689
.testTarget(
690690
name: "PackageCollectionsModelTests",
691-
dependencies: ["PackageCollectionsModel", "SPMTestSupport"]
691+
dependencies: ["PackageCollectionsModel", "_InternalTestSupport"]
692692
),
693693
.testTarget(
694694
name: "PackageCollectionsSigningTests",
695-
dependencies: ["PackageCollectionsSigning", "SPMTestSupport"]
695+
dependencies: ["PackageCollectionsSigning", "_InternalTestSupport"]
696696
),
697697
.testTarget(
698698
name: "PackageCollectionsTests",
699-
dependencies: ["PackageCollections", "SPMTestSupport", "tsan_utils"]
699+
dependencies: ["PackageCollections", "_InternalTestSupport", "tsan_utils"]
700700
),
701701
.testTarget(
702702
name: "PackageFingerprintTests",
703-
dependencies: ["PackageFingerprint", "SPMTestSupport"]
703+
dependencies: ["PackageFingerprint", "_InternalTestSupport"]
704704
),
705705
.testTarget(
706706
name: "PackagePluginAPITests",
707-
dependencies: ["PackagePlugin", "SPMTestSupport"]
707+
dependencies: ["PackagePlugin", "_InternalTestSupport"]
708708
),
709709
.testTarget(
710710
name: "PackageRegistryTests",
711-
dependencies: ["SPMTestSupport", "PackageRegistry"]
711+
dependencies: ["_InternalTestSupport", "PackageRegistry"]
712712
),
713713
.testTarget(
714714
name: "PackageSigningTests",
715-
dependencies: ["SPMTestSupport", "PackageSigning"]
715+
dependencies: ["_InternalTestSupport", "PackageSigning"]
716716
),
717717
.testTarget(
718718
name: "QueryEngineTests",
719-
dependencies: ["QueryEngine", "SPMTestSupport"]
719+
dependencies: ["QueryEngine", "_InternalTestSupport"]
720720
),
721721
.testTarget(
722722
name: "SourceControlTests",
723-
dependencies: ["SourceControl", "SPMTestSupport"],
723+
dependencies: ["SourceControl", "_InternalTestSupport"],
724724
exclude: ["Inputs/TestRepo.tgz"]
725725
),
726726
.testTarget(
727727
name: "XCBuildSupportTests",
728-
dependencies: ["XCBuildSupport", "SPMTestSupport"],
728+
dependencies: ["XCBuildSupport", "_InternalTestSupport"],
729729
exclude: ["Inputs/Foo.pc"]
730730
),
731731
// Examples (These are built to ensure they stay up to date with the API.)
@@ -746,7 +746,7 @@ package.targets.append(contentsOf: [
746746
name: "FunctionalPerformanceTests",
747747
dependencies: [
748748
"swift-package-manager",
749-
"SPMTestSupport",
749+
"_InternalTestSupport",
750750
]
751751
),
752752
])
@@ -760,7 +760,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] ==
760760
dependencies: [
761761
"swift-package-manager",
762762
"PackageModel",
763-
"SPMTestSupport",
763+
"_InternalTestSupport",
764764
]
765765
),
766766

@@ -782,7 +782,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] ==
782782
"PackageModelSyntax",
783783
"PackageRegistryCommand",
784784
"SourceControl",
785-
"SPMTestSupport",
785+
"_InternalTestSupport",
786786
"Workspace",
787787
"dummy-swiftc",
788788
]

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 Basics.AsyncProcess

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)