         return (mode ?? .run(nil), opts)
     }
 
-    private func test(path: AbsolutePath, xctestArg: String? = nil) throws -> Bool {
-        guard isValidTestPath(path) else {
-            throw TestError.testsExecutableNotFound
-        }
+    /// Executes the XCTest binary with given arguments.
+    ///
+    /// - Parameters:
+    ///     - path: Path to a valid XCTest binary.
+    ///     - xctestArg: Arguments to pass to the XCTest binary.
+    ///
+    /// - Returns: True if execution exited with return code 0.
+    private func test(path: AbsolutePath, xctestArg: String? = nil) -> Bool {
+        precondition(isValidTestPath(path))
 
         var args: [String] = []
       #if os(OSX)


    private let configuration = "debug"  //FIXME should swift-test support configuration option?

    /// Locates the XCTest bundle on OSX and XCTest executable on Linux.
    /// First check if <build_path>/debug/<PackageName>Tests.xctest is present, otherwise
    /// walk the build folder and look for folder/file ending with `.xctest`.

                }

            case .run(let specifier):
                try buildTestsIfNeeded(opts)
                let testPath = try determineTestPath(opts: opts)

                let success = test(path: testPath, xctestArg: specifier)
                exit(success ? 0 : 1)
            }
        } catch Error.buildYAMLNotFound {
