Skip to content

Commit

Permalink
Use productsDirectory for run command
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Mar 24, 2020
1 parent 4219f35 commit 5a6c9b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Sources/XCTestExtensions/XCTestExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ extension XCTestCase {
/// Run an external executable in the same location as the test bundle, and
/// return its output.
public func run(_ command: String, arguments: [String] = []) -> XCTestRunner.Result {
let runner = XCTestRunner(for: command)
let url = productsDirectory.appendingPathComponent(command)
let runner = XCTestRunner(for: url)
let result = runner.run(with: arguments)
return result
}
Expand Down
9 changes: 0 additions & 9 deletions Sources/XCTestExtensions/XCTestRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ public class XCTestRunner {
self.cwd = cwd
}

/**
Initialise to run a command in the same built products directory as this test bundle.
*/

public convenience init(for command: String, cwd: URL? = nil, environment: [String:String] = ProcessInfo.processInfo.environment) {
let url = Bundle(for: XCTestRunner.self).bundleURL.deletingLastPathComponent()
self.init(for: url.appendingPathComponent(command), cwd: cwd, environment: environment)
}


/**
Invoke a command and some optional arguments synchronously.
Expand Down

0 comments on commit 5a6c9b3

Please sign in to comment.