 
       let delegate = JobCollectingDelegate()
       let executor = JobExecutor(jobs: [compileFoo, compileMain, link], resolver: resolver, executorDelegate: delegate)
-      try executor.build(.relative(RelativePath("main")))
+      try executor.execute()
 
       let output = try TSCBasic.Process.checkNonZeroExit(args: exec.pathString)
       XCTAssertEqual(output, "5\n")

}

class JobCollectingDelegate: JobExecutorDelegate {
  var started: [Job] = []
  var finished: [(Job, ProcessResult)] = []

  func jobFinished(job: Job, result: ProcessResult, pid: Int) {
    finished.append((job, result))


  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)
  }
}

