 
   func testDependencyDotFilesCross() throws {
     expectNoDotFiles()
-    try tryInitial(extraArguments: [
+    try buildInitialState(extraArguments: [
       "-driver-emit-fine-grained-dependency-dot-file-after-every-import",
     ])
     removeDotFiles()
-    try tryTouchingOther(extraArguments: [
+    try checkNoPropagation(extraArguments: [
       "-driver-emit-fine-grained-dependency-dot-file-after-every-import",
     ])
 

  /// Ensure that the mod date of the input comes back exactly the same via the build-record.
  /// Otherwise the up-to-date calculation in `IncrementalCompilationState` will fail.
  func testBuildRecordDateAccuracy() throws {
    try tryInitial()
    try (1...10).forEach { n in
      try tryNoChange(checkDiagnostics: true)
    }
  }

  func testAddingInput() throws {
#if !os(Linux)
  try testAddingInput(basenameWithoutExt: "another", defining: "nameInAnother")
#endif
  }

  fileprivate struct AddingInputGraphs {
    let initial, afterAddition, afterAfterAddition: ModuleDependencyGraph
    var all: [ModuleDependencyGraph] {
      [initial, afterAddition, afterAfterAddition]
    }
    func verify(newInput: String, topLevelName: String) {
      initial.ensureOmits(sourceBasenameWithoutExt: newInput)
      initial.ensureOmits(name: topLevelName)
      XCTAssert(afterAddition.contains(sourceBasenameWithoutExt: newInput))
      XCTAssert(afterAfterAddition.contains(sourceBasenameWithoutExt: newInput))
      XCTAssert(afterAddition.contains(name: topLevelName))
      XCTAssert(afterAfterAddition.contains(name: topLevelName))
   }
  }

  private func testAddingInput(basenameWithoutExt: String, defining topLevelName: String
  ) throws {
    let initial = try tryInitial(checkDiagnostics: true).moduleDependencyGraph()

    write("func \(topLevelName)() {}", to: basenameWithoutExt)
    let newInputsPath = inputPath(basename: basenameWithoutExt)
    OutputFileMapCreator.write(module: module,
                               inputPaths: inputPathsAndContents.map {$0.0} + [newInputsPath],
                               derivedData: derivedDataPath,
                               to: OFM)
    let afterAddition      = try tryAfterAddition(      newInputBasenameWithoutExt: basenameWithoutExt, definingTopLevel: topLevelName)
    let afterAfterAddition = try tryAfterAfterAddition( newInputBasenameWithoutExt: basenameWithoutExt)

    let resultantGraphs = AddingInputGraphs(initial: initial,
                                            afterAddition: afterAddition,
                                            afterAfterAddition: afterAfterAddition)

    resultantGraphs.verify(newInput: basenameWithoutExt, topLevelName: topLevelName)
  }
}

// MARK: - Incremental test stages
extension IncrementalCompilationTests {
  @discardableResult
  private func tryInitial(checkDiagnostics: Bool = false,
                  extraArguments: [String] = []
  ) throws -> Driver {
    try doABuild(
      "initial",

        "Incremental compilation: Enabling incremental cross-module building",
        "Incremental compilation: May skip current input:  {compile: main.o <= main.swift}",
        "Incremental compilation: May skip current input:  {compile: other.o <= other.swift}",
        "Incremental compilation: Scheduling new  {compile: \(newInput).o <= \(newInput).swift}",
        "Incremental compilation: Has malformed dependency source; will queue  {compile: \(newInput).o <= \(newInput).swift}",
        "Incremental compilation: Missing an output; will queue  {compile: \(newInput).o <= \(newInput).swift}",
        "Incremental compilation: Queuing (initial):  {compile: \(newInput).o <= \(newInput).swift}",
        "Incremental compilation: not scheduling dependents of \(newInput).swift: no entry in build record or dependency graph",
        "Incremental compilation: Skipping input:  {compile: main.o <= main.swift}",
        "Incremental compilation: Skipping input:  {compile: other.o <= other.swift}",
        "Found 1 batchable job",
        "Forming into 1 batch",
        "Adding {compile: \(newInput).swift} to batch 0",
        "Forming batch job from 1 constituents: \(newInput).swift",
        "Starting Compiling \(newInput).swift",
        "Finished Compiling \(newInput).swift",
        "Incremental compilation: New definition: interface of source file \(newInput).swiftdeps in \(newInput).swiftdeps",
        "Incremental compilation: New definition: implementation of source file \(newInput).swiftdeps in \(newInput).swiftdeps",
        "Incremental compilation: New definition: interface of top-level name '\(topLevelName)' in \(newInput).swiftdeps",
        "Incremental compilation: New definition: implementation of top-level name '\(topLevelName)' in \(newInput).swiftdeps",
        "Incremental compilation: Scheduling all post-compile jobs because something was compiled",
        "Starting Linking theModule",
        "Finished Linking theModule",
