@@ -27,8 +27,8 @@ class PrepareForIndexTests: XCTestCase {
27
27
let ( graph, fs, scope) = try macrosPackageGraph ( )
28
28
29
29
let plan = try BuildPlan (
30
- destinationBuildParameters: mockBuildParameters ( destination: . target, prepareForIndexing: true ) ,
31
- toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: false ) ,
30
+ destinationBuildParameters: mockBuildParameters ( destination: . target, prepareForIndexing: . on ) ,
31
+ toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: . off ) ,
32
32
graph: graph,
33
33
fileSystem: fs,
34
34
observabilityScope: scope
@@ -72,8 +72,8 @@ class PrepareForIndexTests: XCTestCase {
72
72
let ( graph, fs, scope) = try trivialPackageGraph ( )
73
73
74
74
let plan = try BuildPlan (
75
- destinationBuildParameters: mockBuildParameters ( destination: . target, prepareForIndexing: true ) ,
76
- toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: false ) ,
75
+ destinationBuildParameters: mockBuildParameters ( destination: . target, prepareForIndexing: . on ) ,
76
+ toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: . off ) ,
77
77
graph: graph,
78
78
fileSystem: fs,
79
79
observabilityScope: scope
@@ -116,8 +116,8 @@ class PrepareForIndexTests: XCTestCase {
116
116
117
117
// Under debug, enable-testing is turned on by default. Make sure the flag is not added.
118
118
let debugPlan = try BuildPlan (
119
- destinationBuildParameters: mockBuildParameters ( destination: . target, config: . debug, prepareForIndexing: true ) ,
120
- toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: false ) ,
119
+ destinationBuildParameters: mockBuildParameters ( destination: . target, config: . debug, prepareForIndexing: . on ) ,
120
+ toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: . off ) ,
121
121
graph: graph,
122
122
fileSystem: fs,
123
123
observabilityScope: observability. topScope
@@ -137,8 +137,8 @@ class PrepareForIndexTests: XCTestCase {
137
137
138
138
// Under release, enable-testing is turned off by default so we should see our flag
139
139
let releasePlan = try BuildPlan (
140
- destinationBuildParameters: mockBuildParameters ( destination: . target, config: . release, prepareForIndexing: true ) ,
141
- toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: false ) ,
140
+ destinationBuildParameters: mockBuildParameters ( destination: . target, config: . release, prepareForIndexing: . on ) ,
141
+ toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: . off ) ,
142
142
graph: graph,
143
143
fileSystem: fs,
144
144
observabilityScope: observability. topScope
@@ -156,4 +156,31 @@ class PrepareForIndexTests: XCTestCase {
156
156
&& !swiftCommand. otherArguments. contains ( " -enable-testing " )
157
157
} ) . count, 1 )
158
158
}
159
+
160
+ func testPrepareNoLazy( ) throws {
161
+ let ( graph, fs, scope) = try macrosPackageGraph ( )
162
+
163
+ let plan = try BuildPlan (
164
+ destinationBuildParameters: mockBuildParameters ( destination: . target, prepareForIndexing: . noLazy) ,
165
+ toolsBuildParameters: mockBuildParameters ( destination: . host, prepareForIndexing: . off) ,
166
+ graph: graph,
167
+ fileSystem: fs,
168
+ observabilityScope: scope
169
+ )
170
+
171
+ let builder = LLBuildManifestBuilder ( plan, fileSystem: fs, observabilityScope: scope)
172
+ let manifest = try builder. generatePrepareManifest ( at: " /manifest " )
173
+
174
+ // Ensure swiftmodules built with correct arguments
175
+ let coreCommands = manifest. commands. values. filter {
176
+ $0. tool. outputs. contains ( where: {
177
+ $0. name. hasSuffix ( " debug/Core.build/Core.swiftmodule " )
178
+ } )
179
+ }
180
+ XCTAssertEqual ( coreCommands. count, 1 )
181
+ let coreSwiftc = try XCTUnwrap ( coreCommands. first? . tool as? SwiftCompilerTool )
182
+ XCTAssertFalse ( coreSwiftc. otherArguments. contains ( " -experimental-lazy-typecheck " ) )
183
+ XCTAssertTrue ( coreSwiftc. otherArguments. contains ( " -experimental-allow-module-with-compiler-errors " ) )
184
+ }
185
+
159
186
}
0 commit comments