@@ -150,48 +150,51 @@ final class SwiftDriverTests: XCTestCase {
150
150
151
151
func testMultithreading( ) throws {
152
152
153
- XCTAssertEqual ( try Driver ( args: [ " swiftc " ] ) . numThreads, 0 )
153
+ XCTAssertEqual ( try Driver ( args: [ " swiftc " ] ) . numThreads, 0 )
154
154
155
- XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -num-threads " , " 4 " ] ) . numThreads, 4 )
155
+ XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -num-threads " , " 4 " ] ) . numThreads, 4 )
156
156
157
- XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -num-threads " , " 0 " ] ) . numThreads, 0 )
157
+ XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -num-threads " , " 0 " ] ) . numThreads, 0 )
158
158
159
- XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -num-threads " , " -1 " ] ) . numThreads, 0 )
159
+ XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -num-threads " , " -1 " ] ) . numThreads, 0 )
160
160
161
- XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -enable-batch-mode " , " -num-threads " , " 4 " ] ) . numThreads, 0 )
161
+ XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -enable-batch-mode " , " -num-threads " , " 4 " ] ) . numThreads, 0 )
162
162
163
- XCTAssertNil ( try Driver ( args: [ " swiftc " ] ) . numParallelJobs)
163
+ XCTAssertNil ( try Driver ( args: [ " swiftc " ] ) . numParallelJobs)
164
164
165
- XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -j " , " 4 " ] ) . numParallelJobs, 4 )
165
+ XCTAssertEqual ( try Driver ( args: [ " swiftc " , " -j " , " 4 " ] ) . numParallelJobs, 4 )
166
166
167
- XCTAssertNil ( try Driver ( args: [ " swiftc " , " -j " , " 0 " ] ) . numParallelJobs)
167
+ XCTAssertNil ( try Driver ( args: [ " swiftc " , " -j " , " 0 " ] ) . numParallelJobs)
168
168
169
- XCTAssertEqual (
170
- try Driver (
171
- args: [ " swiftc " , " -j " , " 4 " , " -target " , " x86_64-apple-macosx10.15 " ] ,
172
- env: [ " SWIFTC_MAXIMUM_DETERMINISM " : " 1 " ]
173
- ) . numParallelJobs,
174
- 1
175
- )
169
+ XCTAssertEqual (
170
+ try Driver (
171
+ args: [ " swiftc " , " -j " , " 4 " , " -target " , " x86_64-apple-macosx10.15 " ] ,
172
+ env: [ " SWIFTC_MAXIMUM_DETERMINISM " : " 1 " ]
173
+ ) . numParallelJobs,
174
+ 1
175
+ )
176
176
}
177
177
178
178
func testMultithreadingDiagnostics( ) throws {
179
179
180
- try assertDriverDiagnostics ( args: " swift " , " -num-threads " , " -1 " ) {
181
- $1. expect ( . error_invalid_arg_value( arg: . numThreads, value: " -1 " ) )
182
- }
180
+ try assertDriverDiagnostics ( args: " swift " , " -num-threads " , " -1 " ) {
181
+ $1. expect ( . error_invalid_arg_value( arg: . numThreads, value: " -1 " ) )
182
+ }
183
183
184
- try assertDriverDiagnostics ( args: " swiftc " , " -enable-batch-mode " , " -num-threads " , " 4 " ) {
185
- $1. expect ( . warning( " ignoring -num-threads argument; cannot multithread batch mode " ) )
186
- }
184
+ try assertDriverDiagnostics ( args: " swiftc " , " -enable-batch-mode " , " -num-threads " , " 4 " ) {
185
+ $1. expect ( . warning( " ignoring -num-threads argument; cannot multithread batch mode " ) )
186
+ }
187
187
188
- try assertDriverDiagnostics ( args: " swiftc " , " -j " , " 0 " ) {
189
- $1. expect ( . error_invalid_arg_value( arg: . j, value: " 0 " ) )
190
- }
188
+ try assertDriverDiagnostics ( args: " swiftc " , " -j " , " 0 " ) {
189
+ $1. expect ( . error_invalid_arg_value( arg: . j, value: " 0 " ) )
190
+ }
191
191
192
- try assertDriverDiagnostics ( args: " swiftc " , " -j " , " 8 " , env: [ " SWIFTC_MAXIMUM_DETERMINISM " : " 1 " ] ) {
193
- $1. expect ( . remark( " SWIFTC_MAXIMUM_DETERMINISM overriding -j " ) )
194
- }
192
+ try assertDriverDiagnostics (
193
+ args: " swiftc " , " -j " , " 8 " , " -target " , " x86_64-apple-macosx10.15 " ,
194
+ env: [ " SWIFTC_MAXIMUM_DETERMINISM " : " 1 " ]
195
+ ) {
196
+ $1. expect ( . remark( " SWIFTC_MAXIMUM_DETERMINISM overriding -j " ) )
197
+ }
195
198
}
196
199
197
200
func testDebugSettings( ) throws {
0 commit comments