 
         // test if tools directory is respected
         do {
-          var driver = try Driver(args: ["swiftc", "-print-target-info", "-tools-directory", toolsDirectory.pathString])
+          var driver = try Driver(args: ["swiftc", "-print-target-info", "-tools-directory", toolsDirectory.pathString],
+                                  env: [PATH: ProcessEnv.path!])
           let jobs = try driver.planBuild()
           XCTAssertEqual(jobs.count, 1)
           XCTAssertEqual(jobs.first!.tool.name, customSwiftFrontend.pathString)


        // test if current working directory is searched before PATH
        do {
          var driver = try Driver(args: ["swiftc", "-print-target-info"], env: ["PATH": toolsDirectory.pathString])
          let jobs = try driver.planBuild()
          XCTAssertEqual(jobs.count, 1)
          XCTAssertEqual(jobs.first!.tool.name, anotherSwiftFrontend.pathString)

  }

  func testToolSearching() throws {
#if os(Windows)
    let PATH = "Path"
#else
    let PATH = "PATH"
#endif
    let SWIFT_FRONTEND_EXEC = "SWIFT_DRIVER_SWIFT_FRONTEND_EXEC"

    // We need to override SWIFT_DRIVER_SWIFT_FRONTEND_EXEC to prevent it from interfering the tests.
    var driver = try Driver(args: ["swiftc", "-print-target-info"], env: [PATH: ProcessEnv.path!])
    let jobs = try driver.planBuild()
    XCTAssertEqual(jobs.count, 1)
    let defaultSwiftFrontend = jobs.first!.tool.absolutePath!
