@@ -5,7 +5,7 @@ import Testing
55@testable import SwiftPackageManagerKit
66
77@Suite
8- struct PackageDSLManagerSPMTests {
8+ internal struct PackageDSLManagerSPMTests {
99 @Test (
1010 . disabled(
1111 if: ProcessInfo . processInfo. shouldDisableSPMValidation ( ) ,
@@ -16,8 +16,9 @@ struct PackageDSLManagerSPMTests {
1616 " Unable to run SPM commands in non-macOS platforms "
1717 )
1818 )
19- func validateGeneratedPackageWithSPMValidation( ) async throws {
20- print ( " Is running Xcode Test in Github CI? \( ProcessInfo . processInfo. shouldDisableSPMValidation ( ) ) " )
19+ internal func validateGeneratedPackageWithSPMValidation( ) async throws {
20+ print (
21+ " Is running Xcode Test in Github CI? \( ProcessInfo . processInfo. shouldDisableSPMValidation ( ) ) " )
2122 print ( " Does allow Process API? \( Platform . allowsProcess) " )
2223 #if canImport(Foundation) && (os(macOS) || os(Linux))
2324 let tempDirectory = FileManager . default. temporaryDirectory
@@ -95,47 +96,47 @@ struct PackageDSLManagerSPMTests {
9596 try packageSwiftContent. write ( to: packageSwiftFile, atomically: true , encoding: . utf8)
9697 }
9798
98- #if canImport(Foundation) && (os(macOS) || os(Linux))
99- private func validateWithSPMCommands( _ tempDirectory: URL ) async throws -> Executor {
100- // Test SPM commands through our SPMExecutor
101- let spmExecutor = try Executor ( packageDirectory: tempDirectory, defaultTimeout: 60 )
99+ #if canImport(Foundation) && (os(macOS) || os(Linux))
100+ private func validateWithSPMCommands( _ tempDirectory: URL ) async throws -> Executor {
101+ // Test SPM commands through our SPMExecutor
102+ let spmExecutor = try Executor ( packageDirectory: tempDirectory, defaultTimeout: 60 )
102103
103- // Test package dump-package
104- let packageInfo = try await spmExecutor. dumpPackage ( )
105- #expect( packageInfo. name == " SPMValidationTest " )
106- #expect( packageInfo. products. count == 1 )
107- #expect( packageInfo. products. first? . name == " SPMValidationTest " )
108- #expect( packageInfo. targets. count == 1 )
109- #expect( packageInfo. targets. first? . name == " SPMValidationTest " )
104+ // Test package dump-package
105+ let packageInfo = try await spmExecutor. dumpPackage ( )
106+ #expect( packageInfo. name == " SPMValidationTest " )
107+ #expect( packageInfo. products. count == 1 )
108+ #expect( packageInfo. products. first? . name == " SPMValidationTest " )
109+ #expect( packageInfo. targets. count == 1 )
110+ #expect( packageInfo. targets. first? . name == " SPMValidationTest " )
110111
111- // Test package resolve (should be quick since no external dependencies)
112- try await spmExecutor. resolvePackage ( )
112+ // Test package resolve (should be quick since no external dependencies)
113+ try await spmExecutor. resolvePackage ( )
113114
114- // Test build (this ensures the package structure is correct)
115- try await spmExecutor. buildPackage ( )
115+ // Test build (this ensures the package structure is correct)
116+ try await spmExecutor. buildPackage ( )
116117
117- // Verify build artifacts were created
118- let buildDirectory = tempDirectory. appendingPathComponent ( " .build " )
119- #expect( FileManager . default. fileExists ( atPath: buildDirectory. path) )
118+ // Verify build artifacts were created
119+ let buildDirectory = tempDirectory. appendingPathComponent ( " .build " )
120+ #expect( FileManager . default. fileExists ( atPath: buildDirectory. path) )
120121
121- return spmExecutor
122- }
122+ return spmExecutor
123+ }
123124
124- private func validateCoexistenceOfFormats( _ packageManager: PackageDSLManager ) async {
125- // Test that our PackageDSLManager can detect the traditional Package.swift
126- #expect( await packageManager. hasTraditionalPackageSwift ( ) )
125+ private func validateCoexistenceOfFormats( _ packageManager: PackageDSLManager ) async {
126+ // Test that our PackageDSLManager can detect the traditional Package.swift
127+ #expect( await packageManager. hasTraditionalPackageSwift ( ) )
127128
128- // Generate DSL files alongside the Package.swift
129- do {
130- try await packageManager. generatePackageSwift ( )
131- } catch {
132- Issue . record ( " Failed to generate DSL files: \( error) " )
133- return
134- }
129+ // Generate DSL files alongside the Package.swift
130+ do {
131+ try await packageManager. generatePackageSwift ( )
132+ } catch {
133+ Issue . record ( " Failed to generate DSL files: \( error) " )
134+ return
135+ }
135136
136- // Verify both formats coexist
137- #expect( await packageManager. hasTraditionalPackageSwift ( ) )
138- #expect( await packageManager. hasDSLComponents ( ) )
139- }
137+ // Verify both formats coexist
138+ #expect( await packageManager. hasTraditionalPackageSwift ( ) )
139+ #expect( await packageManager. hasDSLComponents ( ) )
140+ }
140141 #endif
141142}
0 commit comments