       try withTemporaryDirectory { path in
         try withHijackedBufferedErrorStream(in: path) { errorBuffer in
           let resolver = try ArgsResolver(fileSystem: localFileSystem)
+
+          let workdir: AbsolutePath =
+                try localFileSystem.currentWorkingDirectory.map { AbsolutePath("/WorkDir", relativeTo: $0) } ?? AbsolutePath(validating: "/WorkDir")
+
           var driver = try Driver(args: ["swiftc", "-o", "test.o",
                                          "main.swift", "test1.swift", "test2.swift",
                                          "-enable-batch-mode", "-driver-batch-count", "1",
-                                         "-working-directory", "/WorkDir"])
+                                         "-working-directory", workdir.pathString])
           let jobs = try driver.planBuild()
           let compileJob = jobs[0]
           let args : [String] = try resolver.resolveArgumentList(for: compileJob, forceResponseFiles: false)

import XCTest
import TSCBasic
import TSCUtility

@_spi(Testing) import SwiftDriver


          let errorOutput = try localFileSystem.readFileContents(errorBuffer).description
          XCTAssertTrue(errorOutput.contains(
          """
            \"kind\" : \"\(kind)\",
            \"name\" : \"compile\",
            \"pid\" : -1000,
            \"process\" : {
              \"real_pid\" : 42
            }\(signal)
          }
          """))
          XCTAssertTrue(errorOutput.contains(
          """
            \"kind\" : \"\(kind)\",
            \"name\" : \"compile\",
            \"pid\" : -1001,
            \"process\" : {
              \"real_pid\" : 42
            }\(signal)
          }
          """))
          XCTAssertTrue(errorOutput.contains(
          """
            \"kind\" : \"\(kind)\",
            \"name\" : \"compile\",
            \"pid\" : -1002,
            \"process\" : {
              \"real_pid\" : 42
            }\(signal)
          }
          """))
        }
