@@ -39,8 +39,11 @@ final class MultiNodeTestPlugin: CommandPlugin {
39
39
}
40
40
}
41
41
42
+ // Find the executable dependency frome the plugin context.
43
+ let tool = try context. tool ( named: " MultiNodeTestKitRunner " )
44
+
42
45
// Terminate all previous runners
43
- Process . killall ( name: " MultiNodeTestKitRunner " )
46
+ Process . killall ( name: tool . name )
44
47
45
48
switch self . buildConfiguration {
46
49
case . debug:
@@ -71,14 +74,14 @@ final class MultiNodeTestPlugin: CommandPlugin {
71
74
log ( " Detected multi-node test runner: \( multiNodeRunner. path. lastComponent) " )
72
75
73
76
let process = Process ( )
74
- process. binaryPath = " /usr/bin/swift "
75
- process. arguments = [ " run " , " MultiNodeTestKitRunner " ]
77
+ process. binaryPath = tool . path . string
78
+ process. arguments = [ ]
76
79
for arg in arguments {
77
80
process. arguments? . append ( arg)
78
81
}
79
82
80
83
do {
81
- log ( " > swift \( process. arguments? . joined ( separator: " " ) ?? " " ) " )
84
+ log ( " > \( tool . name ) \( process. arguments? . joined ( separator: " " ) ?? " " ) " )
82
85
try process. runProcess ( )
83
86
process. waitUntilExit ( )
84
87
} catch {
@@ -144,7 +147,7 @@ extension Process {
144
147
static func killall( name: String ) {
145
148
let killAllRunners = Process ( )
146
149
killAllRunners. binaryPath = " /usr/bin/killall "
147
- killAllRunners. arguments = [ " -9 " , " MultiNodeTestKitRunner " ]
150
+ killAllRunners. arguments = [ " -9 " , name ]
148
151
try ? killAllRunners. runProcess ( )
149
152
killAllRunners. waitUntilExit ( )
150
153
}
0 commit comments