Skip to content

Commit 0a23148

Browse files
committed
Fix Linux warning about deprecated Process API
1 parent 916e5c6 commit 0a23148

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Sources/SKTestSupport/SKSwiftPMTestWorkspace.swift

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,15 @@ extension SKSwiftPMTestWorkspace {
107107
index.pollForUnitChangesAndWait()
108108
}
109109

110-
public enum Error: Swift.Error {
111-
case buildFailure(Foundation.Process.TerminationReason, exitCode: Int32)
112-
}
113-
114110
func build() throws {
115-
let p = Process()
116-
p.launchPath = String(toolchain.swiftc!.pathString.dropLast())
117-
p.arguments = [
111+
try Basic.Process.checkNonZeroExit(arguments: [
112+
String(toolchain.swiftc!.pathString.dropLast()),
118113
"build",
119114
"--package-path", sources.rootDirectory.path,
120115
"--build-path", buildDir.path,
121116
"-Xswiftc", "-index-ignore-system-modules",
122117
"-Xcc", "-index-ignore-system-symbols",
123-
]
124-
125-
p.launch()
126-
p.waitUntilExit()
127-
if p.terminationReason != .exit || p.terminationStatus != 0 {
128-
throw Error.buildFailure(p.terminationReason, exitCode: p.terminationStatus)
129-
}
118+
])
130119
}
131120
}
132121

0 commit comments

Comments
 (0)