@@ -120,10 +120,10 @@ final class PluginInvocationTests: XCTestCase {
120120 buildPlanResult. checkTargetsCount ( 5 ) // Note: plugins are not included here.
121121
122122 buildPlanResult. check ( destination: . target, for: " Foo " )
123-
123+
124124 buildPlanResult. check ( destination: . host, for: " FooTool " )
125125 buildPlanResult. check ( destination: . target, for: " FooTool " )
126-
126+
127127 buildPlanResult. check ( destination: . host, for: " FooToolLib " )
128128 buildPlanResult. check ( destination: . target, for: " FooToolLib " )
129129 }
@@ -135,7 +135,7 @@ final class PluginInvocationTests: XCTestCase {
135135 return try UserToolchain . default. targetTriple
136136 }
137137 }
138-
138+
139139 func compilePluginScript(
140140 sourceFiles: [ AbsolutePath ] ,
141141 pluginName: String ,
@@ -149,7 +149,7 @@ final class PluginInvocationTests: XCTestCase {
149149 completion ( . failure( StringError ( " unimplemented " ) ) )
150150 }
151151 }
152-
152+
153153 func runPluginScript(
154154 sourceFiles: [ AbsolutePath ] ,
155155 pluginName: String ,
@@ -173,7 +173,7 @@ final class PluginInvocationTests: XCTestCase {
173173 callbackQueue. sync {
174174 delegate. handleOutput ( data: Data ( " Hello Plugin! " . utf8) )
175175 }
176-
176+
177177 // Pretend it emitted a warning.
178178 try callbackQueue. sync {
179179 let message = Data ( """
@@ -262,7 +262,7 @@ final class PluginInvocationTests: XCTestCase {
262262 XCTAssertEqual ( evalFirstCommand. configuration. arguments, [ " -c " , " /Foo/Sources/Foo/SomeFile.abc " ] )
263263 XCTAssertEqual ( evalFirstCommand. configuration. environment, [ " X " : " Y " ] )
264264 XCTAssertEqual ( evalFirstCommand. configuration. workingDirectory, AbsolutePath ( " /Foo/Sources/Foo " ) )
265- XCTAssertEqual ( evalFirstCommand. inputFiles, [ builtToolsDir. appending ( " FooTool " ) ] )
265+ XCTAssertEqual ( evalFirstCommand. inputFiles, [ builtToolsDir. appending ( " FooTool " + ProcessInfo . exeSuffix ) ] )
266266 XCTAssertEqual ( evalFirstCommand. outputFiles, [ ] )
267267
268268 XCTAssertEqual ( evalFirstResult. diagnostics. count, 1 )
@@ -273,7 +273,7 @@ final class PluginInvocationTests: XCTestCase {
273273
274274 XCTAssertEqual ( evalFirstResult. textOutput, " Hello Plugin! " )
275275 }
276-
276+
277277 func testCompilationDiagnostics( ) async throws {
278278 try await testWithTemporaryDirectory { tmpPath in
279279 // Create a sample package with a library target and a plugin.
@@ -298,13 +298,13 @@ final class PluginInvocationTests: XCTestCase {
298298 ]
299299 )
300300 """ )
301-
301+
302302 let myLibraryTargetDir = packageDir. appending ( components: " Sources " , " MyLibrary " )
303303 try localFileSystem. createDirectory ( myLibraryTargetDir, recursive: true )
304304 try localFileSystem. writeFileContents ( myLibraryTargetDir. appending ( " library.swift " ) , string: """
305305 public func Foo() { }
306306 """ )
307-
307+
308308 let myPluginTargetDir = packageDir. appending ( components: " Plugins " , " MyPlugin " )
309309 try localFileSystem. createDirectory ( myPluginTargetDir, recursive: true )
310310 try localFileSystem. writeFileContents ( myPluginTargetDir. appending ( " plugin.swift " ) , string: """
@@ -327,7 +327,7 @@ final class PluginInvocationTests: XCTestCase {
327327 customManifestLoader: ManifestLoader ( toolchain: UserToolchain . default) ,
328328 delegate: MockWorkspaceDelegate ( )
329329 )
330-
330+
331331 // Load the root manifest.
332332 let rootInput = PackageGraphRootInput ( packages: [ packageDir] , dependencies: [ ] )
333333 let rootManifests = try await workspace. loadRootManifests (
@@ -343,7 +343,7 @@ final class PluginInvocationTests: XCTestCase {
343343 )
344344 XCTAssertNoDiagnostics ( observability. diagnostics)
345345 XCTAssert ( packageGraph. packages. count == 1 , " \( packageGraph. packages) " )
346-
346+
347347 // Find the build tool plugin.
348348 let buildToolPlugin = try XCTUnwrap ( packageGraph. packages. first? . modules. map ( \. underlying) . first { $0. name == " MyPlugin " } as? PluginModule )
349349 XCTAssertEqual ( buildToolPlugin. name, " MyPlugin " )
@@ -356,10 +356,10 @@ final class PluginInvocationTests: XCTestCase {
356356 cacheDir: pluginCacheDir,
357357 toolchain: try UserToolchain . default
358358 )
359-
359+
360360 // Define a plugin compilation delegate that just captures the passed information.
361361 class Delegate : PluginScriptCompilerDelegate {
362- var commandLine : [ String ] ?
362+ var commandLine : [ String ] ?
363363 var environment : Environment ?
364364 var compiledResult : PluginCompilationResult ?
365365 var cachedResult : PluginCompilationResult ?
@@ -402,7 +402,7 @@ final class PluginInvocationTests: XCTestCase {
402402 XCTAssertNotNil ( delegate. environment)
403403 XCTAssertEqual ( delegate. compiledResult, result)
404404 XCTAssertNil ( delegate. cachedResult)
405-
405+
406406 // Check the serialized diagnostics. We should have an error.
407407 let diaFileContents = try localFileSystem. readFileContents ( result. diagnosticsFile)
408408 let diagnosticsSet = try SerializedDiagnostics ( bytes: diaFileContents)
@@ -427,7 +427,7 @@ final class PluginInvocationTests: XCTestCase {
427427 }
428428 }
429429 """ )
430-
430+
431431 // Try to compile the fixed plugin.
432432 let firstExecModTime : Date
433433 do {
@@ -566,7 +566,7 @@ final class PluginInvocationTests: XCTestCase {
566566 XCTAssertNotNil ( delegate. environment)
567567 XCTAssertEqual ( delegate. compiledResult, result)
568568 XCTAssertNil ( delegate. cachedResult)
569-
569+
570570 // Check that the diagnostics no longer have a warning.
571571 let diaFileContents = try localFileSystem. readFileContents ( result. diagnosticsFile)
572572 let diagnosticsSet = try SerializedDiagnostics ( bytes: diaFileContents)
@@ -619,7 +619,7 @@ final class PluginInvocationTests: XCTestCase {
619619 XCTAssertNotNil ( delegate. environment)
620620 XCTAssertEqual ( delegate. compiledResult, result)
621621 XCTAssertNil ( delegate. cachedResult)
622-
622+
623623 // Check the diagnostics. We should have a different error than the original one.
624624 let diaFileContents = try localFileSystem. readFileContents ( result. diagnosticsFile)
625625 let diagnosticsSet = try SerializedDiagnostics ( bytes: diaFileContents)
@@ -888,7 +888,7 @@ final class PluginInvocationTests: XCTestCase {
888888 }
889889 }
890890 """ )
891-
891+
892892 let artifactVariants = [ try UserToolchain . default. targetTriple] . map {
893893 """
894894 { " path " : " Y " , " supportedTriples " : [ " \( $0. tripleString) " ] }
@@ -1116,7 +1116,7 @@ final class PluginInvocationTests: XCTestCase {
11161116
11171117 let diags = result. flatMap ( \. value. results) . flatMap ( \. diagnostics)
11181118 testDiagnostics ( diags) { result in
1119- let msg = " a prebuild command cannot use executables built from source, including executable target 'Y ' "
1119+ let msg = " a prebuild command cannot use executables built from source, including executable target ' \( " Y " + ProcessInfo . exeSuffix ) ' "
11201120 result. check ( diagnostic: . contains( msg) , severity: . error)
11211121 }
11221122 }
@@ -1235,7 +1235,7 @@ final class PluginInvocationTests: XCTestCase {
12351235 ) throws -> [Command] { }
12361236 }
12371237 """ )
1238-
1238+
12391239 // Create a valid swift interface file that can be detected via `canImport()`.
12401240 let fakeExtraModulesDir = tmpPath. appending ( " ExtraModules " )
12411241 try localFileSystem. createDirectory ( fakeExtraModulesDir, recursive: true )
@@ -1244,7 +1244,7 @@ final class PluginInvocationTests: XCTestCase {
12441244 // swift-interface-format-version: 1.0
12451245 // swift-module-flags: -module-name ModuleFoundViaExtraSearchPaths
12461246 """ )
1247-
1247+
12481248 /////////
12491249 // Load a workspace from the package.
12501250 let observability = ObservabilitySystem . makeForTesting ( )
@@ -1581,5 +1581,5 @@ extension BuildPlanResult {
15811581 $0. module. name == target && $0. destination == destination
15821582 }
15831583 XCTAssertEqual ( targets. count, 1 , file: file, line: line)
1584- }
1584+ }
15851585}
0 commit comments