Skip to content

Commit abe1e9b

Browse files
author
David Ungar
committed
add comparator test
1 parent ae64f47 commit abe1e9b

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
}
3+
}
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
f
2+
}
3+
}
4+
}
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Swift source ranges file v0 ###
2+
---
3+
unparsedRangesByNonPrimary: {}
4+
noninlinableFunctionBodies: []
5+
...

test/Driver/Dependencies/Inputs/range-sourcecomparator/output.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"object": "./in5.o",
2020
"swift-dependencies": "./in5.swiftdeps"
2121
},
22+
"./in6.swift": {
23+
"object": "./in6.o",
24+
"swift-dependencies": "./in6.swiftdeps"
25+
},
2226
"": {
2327
"swift-dependencies": "./main~buildrecord.swiftdeps"
2428
}

test/Driver/Dependencies/range-sourcecomparator.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
// Tests the diff algorithm (the SourceComparator) used for range-based
22
// incremental compilation.
3+
//
4+
// If you try to add inputs, be sure to update output.json and add a swiftranges
5+
// input.
36

47
// Copy in the inputs.
5-
// The lack of a build record or swiftdeps files should disable incremental compilation
8+
69

710
// Ensure that the extra outputs are not generated when they should not be:
811
// RUN: %empty-directory(%t)
912
// RUN: cp -r %S/Inputs/range-sourcecomparator/* %t
10-
// RUN: cd %t && %swiftc_driver -output-file-map %t/output.json -incremental -c ./in1.swift ./in2.swift ./in3.swift ./in4.swift ./in5.swift -module-name main -incremental -enable-source-range-dependencies -driver-dump-compiled-source-diffs -driver-skip-execution >& output
1113

12-
// RUN: %FileCheck %s <%t/output --match-full-lines
14+
// The lack of a build record or swiftdeps files should disable incremental compilation
15+
// So, do one run just to build the build record
16+
17+
// RUN: cd %t && %swiftc_driver -output-file-map %t/output.json -incremental -c ./in1.swift ./in2.swift ./in3.swift ./in4.swift ./in5.swift ./in6.swift -module-name main -incremental -enable-source-range-dependencies -driver-dump-compiled-source-diffs -driver-skip-execution -driver-compare-incremental-schemes >& output
18+
19+
// RUN: cd %t && %swiftc_driver -output-file-map %t/output.json -incremental -c ./in1.swift ./in2.swift ./in3.swift ./in4.swift ./in5.swift ./in6.swift -module-name main -incremental -enable-source-range-dependencies -driver-dump-compiled-source-diffs -driver-skip-execution -driver-compare-incremental-schemes >& output1
20+
21+
22+
// RUN: %FileCheck %s <%t/output1 --match-full-lines
1323
// CHECK: *** all changed ranges in 'in1.swift' (w.r.t previously-compiled) ***
1424
// CHECK-NEXT: - [2:1--2:15)
1525
// CHECK-NEXT: *** all changed ranges in 'in1.swift' (w.r.t to-be-compiled) ***

0 commit comments

Comments
 (0)