                 throw TestError.testsExecutableNotFound
             }
 
-            return AbsolutePath(path.abspath)
-        }
+            possibleTestPath = AbsolutePath(path.abspath)
+        }
+
+        guard isValidTestPath(possibleTestPath) else {
+            throw TestError.testsExecutableNotFound
+        }
+        return possibleTestPath
     }
 
     private func usage(_ print: (String) -> Void = { print($0) }) {

        return (mode ?? .run(nil), opts)
    }

    private func test(path: AbsolutePath, xctestArg: String? = nil) throws -> Bool {
        guard isValidTestPath(path) else {
            throw TestError.testsExecutableNotFound
        }

        var args: [String] = []
      #if os(OSX)

                }

            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 {
