@@ -49,12 +49,12 @@ final class IncrementalBuildTests: XCTestCase {
49
49
let llbuildManifest = prefix. appending ( components: " .build " , " debug.yaml " )
50
50
51
51
// Modify the source file in a way that changes its size so that the low-level
52
- // build system can detect the change. The timestamp change might be too less
53
- // for it to detect .
52
+ // build system can detect the change (the timestamp change might be too small
53
+ // for the granularity of the file system to represent as distinct values) .
54
54
let sourceFile = prefix. appending ( components: " Sources " , " Foo.c " )
55
- let stream = BufferedOutputByteStream ( )
56
- stream <<< ( try localFileSystem. readFileContents ( sourceFile) ) <<< " \n "
57
- try localFileSystem. writeFileContents ( sourceFile, bytes: stream . bytes)
55
+ let sourceStream = BufferedOutputByteStream ( )
56
+ sourceStream <<< ( try localFileSystem. readFileContents ( sourceFile) ) <<< " \n "
57
+ try localFileSystem. writeFileContents ( sourceFile, bytes: sourceStream . bytes)
58
58
59
59
// Read the first llbuild manifest.
60
60
let llbuildContents1 = try localFileSystem. readFileContents ( llbuildManifest)
@@ -76,6 +76,18 @@ final class IncrementalBuildTests: XCTestCase {
76
76
77
77
XCTAssertEqual ( llbuildContents1, llbuildContents2)
78
78
XCTAssertEqual ( llbuildContents2, llbuildContents3)
79
+
80
+ // Modify the header file in a way that changes its size so that the low-level
81
+ // build system can detect the change (the timestamp change might be too small
82
+ // for the granularity of the file system to represent as distinct values).
83
+ let headerFile = prefix. appending ( components: " Sources " , " include " , " Foo.h " )
84
+ let headerStream = BufferedOutputByteStream ( )
85
+ headerStream <<< ( try localFileSystem. readFileContents ( headerFile) ) <<< " \n "
86
+ try localFileSystem. writeFileContents ( headerFile, bytes: headerStream. bytes)
87
+
88
+ // Now build again. This should be an incremental build.
89
+ let ( log4, _) = try executeSwiftBuild ( prefix)
90
+ XCTAssertTrue ( log4. contains ( " Compiling CLibrarySources Foo.c " ) )
79
91
}
80
92
}
81
93
0 commit comments