@@ -83,7 +83,8 @@ final class PackageToolTests: XCTestCase {
8383
8484 func testDescribe( ) throws {
8585 fixture ( name: " CFamilyTargets/SwiftCMixed " ) { prefix in
86- let output = try execute ( [ " describe " , " --type=json " ] , packagePath: prefix)
86+ let result = try SwiftPMProduct . SwiftPackage. executeProcess ( [ " describe " , " --type=json " ] , packagePath: prefix)
87+ let output = try result. utf8Output ( )
8788 let json = try JSON ( bytes: ByteString ( encodingAsUTF8: output) )
8889
8990 XCTAssertEqual ( json [ " name " ] ? . string, " SwiftCMixed " )
@@ -126,19 +127,17 @@ final class PackageToolTests: XCTestCase {
126127 func testShowDependencies( ) throws {
127128 fixture ( name: " DependencyResolution/External/Complex " ) { prefix in
128129 let packageRoot = prefix. appending ( component: " app " )
129- let textOutput = try execute ( [ " show-dependencies " , " --format=text " ] , packagePath: packageRoot)
130+ let textOutput = try SwiftPMProduct . SwiftPackage . executeProcess ( [ " show-dependencies " , " --format=text " ] , packagePath: packageRoot) . utf8Output ( )
130131 XCTAssert ( textOutput
. contains ( " [email protected] " ) ) 131132
132- // FIXME: We have to fetch first otherwise the fetching output is mingled with the JSON data.
133- let jsonOutput = try execute ( [ " show-dependencies " , " --format=json " ] , packagePath: packageRoot)
134- print ( " output = \( jsonOutput) " )
133+ let jsonOutput = try SwiftPMProduct . SwiftPackage. executeProcess ( [ " show-dependencies " , " --format=json " ] , packagePath: packageRoot) . utf8Output ( )
135134 let json = try JSON ( bytes: ByteString ( encodingAsUTF8: jsonOutput) )
136135 guard case let . dictionary( contents) = json else { XCTFail ( " unexpected result " ) ; return }
137136 guard case let . string( name) ? = contents [ " name " ] else { XCTFail ( " unexpected result " ) ; return }
138137 XCTAssertEqual ( name, " Dealer " )
139138 guard case let . string( path) ? = contents [ " path " ] else { XCTFail ( " unexpected result " ) ; return }
140139 XCTAssertEqual ( resolveSymlinks ( AbsolutePath ( path) ) , resolveSymlinks ( packageRoot) )
141- }
140+ }
142141 }
143142
144143 func testInitEmpty( ) throws {
0 commit comments