     )
 
     let delegate = JobCollectingDelegate()
+    delegate.useStubProcess = true
     let executor = JobExecutor(
       jobs: [job], resolver: try ArgsResolver(),
-      executorDelegate: delegate,
-      processProtocol: StubProcess.self
+      executorDelegate: delegate
     )
-    try executor.build(.temporary(RelativePath("main")))
+    try executor.execute()
 
     XCTAssertEqual(try delegate.finished[0].1.utf8Output(), "test")
   }


      let delegate = JobCollectingDelegate()
      let executor = JobExecutor(jobs: [compileFoo, compileMain, link], resolver: resolver, executorDelegate: delegate)
      try executor.build(.relative(RelativePath("main")))

      let output = try TSCBasic.Process.checkNonZeroExit(args: exec.pathString)
      XCTAssertEqual(output, "5\n")


  func jobStarted(job: Job, arguments: [String], pid: Int) {
    started.append(job)
  }

  func launchProcess(for job: Job, arguments: [String]) throws -> ProcessProtocol {
    if useStubProcess {
      return StubProcess()
    }
    return try TSCBasic.Process.launchProcess(arguments: arguments)
  }
}

