11
11
@testable @_spi ( Experimental) @_spi ( ForToolsIntegrationOnly) import Testing
12
12
private import TestingInternals
13
13
14
- private func configurationForSwiftPMEntryPoint ( withArguments args: [ String ] ) throws -> Configuration {
14
+ private func configurationForEntryPoint ( withArguments args: [ String ] ) throws -> Configuration {
15
15
let args = try parseCommandLineArguments ( from: args)
16
- return try configurationForSwiftPMEntryPoint ( from: args)
16
+ return try configurationForEntryPoint ( from: args)
17
17
}
18
18
19
19
@Suite ( " Swift Package Manager Integration Tests " )
@@ -27,19 +27,19 @@ struct SwiftPMTests {
27
27
28
28
@Test ( " --parallel/--no-parallel argument " )
29
29
func parallel( ) throws {
30
- var configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " ] )
30
+ var configuration = try configurationForEntryPoint ( withArguments: [ " PATH " ] )
31
31
#expect( configuration. isParallelizationEnabled)
32
32
33
- configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --parallel " ] )
33
+ configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --parallel " ] )
34
34
#expect( configuration. isParallelizationEnabled)
35
35
36
- configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --no-parallel " ] )
36
+ configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --no-parallel " ] )
37
37
#expect( !configuration. isParallelizationEnabled)
38
38
}
39
39
40
40
@Test ( " No --filter or --skip argument " )
41
41
func defaultFiltering( ) async throws {
42
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " ] )
42
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " ] )
43
43
let test1 = Test ( name: " hello " ) { }
44
44
let test2 = Test ( name: " goodbye " ) { }
45
45
let plan = await Runner . Plan ( tests: [ test1, test2] , configuration: configuration)
@@ -51,7 +51,7 @@ struct SwiftPMTests {
51
51
@Test ( " --filter argument " )
52
52
@available ( _regexAPI, * )
53
53
func filter( ) async throws {
54
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --filter " , " hello " ] )
54
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --filter " , " hello " ] )
55
55
let test1 = Test ( name: " hello " ) { }
56
56
let test2 = Test ( name: " goodbye " ) { }
57
57
let plan = await Runner . Plan ( tests: [ test1, test2] , configuration: configuration)
@@ -63,7 +63,7 @@ struct SwiftPMTests {
63
63
@Test ( " Multiple --filter arguments " )
64
64
@available ( _regexAPI, * )
65
65
func multipleFilter( ) async throws {
66
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --filter " , " hello " , " --filter " , " sorry " ] )
66
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --filter " , " hello " , " --filter " , " sorry " ] )
67
67
let test1 = Test ( name: " hello " ) { }
68
68
let test2 = Test ( name: " goodbye " ) { }
69
69
let test3 = Test ( name: " sorry " ) { }
@@ -77,17 +77,17 @@ struct SwiftPMTests {
77
77
@Test ( " --filter or --skip argument with bad regex " )
78
78
func badArguments( ) throws {
79
79
#expect( throws: ( any Error ) . self) {
80
- _ = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --filter " , " ( " ] )
80
+ _ = try configurationForEntryPoint ( withArguments: [ " PATH " , " --filter " , " ( " ] )
81
81
}
82
82
#expect( throws: ( any Error ) . self) {
83
- _ = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --skip " , " ) " ] )
83
+ _ = try configurationForEntryPoint ( withArguments: [ " PATH " , " --skip " , " ) " ] )
84
84
}
85
85
}
86
86
87
87
@Test ( " --skip argument " )
88
88
@available ( _regexAPI, * )
89
89
func skip( ) async throws {
90
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --skip " , " hello " ] )
90
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --skip " , " hello " ] )
91
91
let test1 = Test ( name: " hello " ) { }
92
92
let test2 = Test ( name: " goodbye " ) { }
93
93
let plan = await Runner . Plan ( tests: [ test1, test2] , configuration: configuration)
@@ -98,7 +98,7 @@ struct SwiftPMTests {
98
98
99
99
@Test ( " .hidden trait " )
100
100
func hidden( ) async throws {
101
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " ] )
101
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " ] )
102
102
let test1 = Test ( name: " hello " ) { }
103
103
let test2 = Test ( . hidden, name: " goodbye " ) { }
104
104
let plan = await Runner . Plan ( tests: [ test1, test2] , configuration: configuration)
@@ -110,7 +110,7 @@ struct SwiftPMTests {
110
110
@Test ( " --filter/--skip arguments and .hidden trait " )
111
111
@available ( _regexAPI, * )
112
112
func filterAndSkipAndHidden( ) async throws {
113
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --filter " , " hello " , " --skip " , " hello2 " ] )
113
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --filter " , " hello " , " --skip " , " hello2 " ] )
114
114
let test1 = Test ( name: " hello " ) { }
115
115
let test2 = Test ( name: " hello2 " ) { }
116
116
let test3 = Test ( . hidden, name: " hello " ) { }
@@ -128,7 +128,7 @@ struct SwiftPMTests {
128
128
func xunitOutputWithBadPath( ) {
129
129
// Test that a bad path produces an error.
130
130
#expect( throws: CError . self) {
131
- _ = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --xunit-output " , " /nonexistent/path/we/cannot/write/to " ] )
131
+ _ = try configurationForEntryPoint ( withArguments: [ " PATH " , " --xunit-output " , " /nonexistent/path/we/cannot/write/to " ] )
132
132
}
133
133
}
134
134
@@ -142,7 +142,7 @@ struct SwiftPMTests {
142
142
_ = remove ( temporaryFilePath)
143
143
}
144
144
do {
145
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --xunit-output " , temporaryFilePath] )
145
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --xunit-output " , temporaryFilePath] )
146
146
let eventContext = Event . Context ( )
147
147
configuration. eventHandler ( Event ( . runStarted, testID: nil , testCaseID: nil ) , eventContext)
148
148
configuration. eventHandler ( Event ( . runEnded, testID: nil , testCaseID: nil ) , eventContext)
@@ -176,7 +176,7 @@ struct SwiftPMTests {
176
176
_ = remove ( temporaryFilePath)
177
177
}
178
178
do {
179
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --experimental-event-stream-output " , temporaryFilePath] )
179
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --experimental-event-stream-output " , temporaryFilePath] )
180
180
let eventContext = Event . Context ( )
181
181
configuration. handleEvent ( Event ( . runStarted, testID: nil , testCaseID: nil ) , in: eventContext)
182
182
do {
@@ -197,23 +197,23 @@ struct SwiftPMTests {
197
197
@Test ( " --repetitions argument (alone) " )
198
198
@available ( _regexAPI, * )
199
199
func repetitions( ) throws {
200
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --repetitions " , " 2468 " ] )
200
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --repetitions " , " 2468 " ] )
201
201
#expect( configuration. repetitionPolicy. maximumIterationCount == 2468 )
202
202
#expect( configuration. repetitionPolicy. continuationCondition == nil )
203
203
}
204
204
205
205
@Test ( " --repeat-until pass argument (alone) " )
206
206
@available ( _regexAPI, * )
207
207
func repeatUntilPass( ) throws {
208
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --repeat-until " , " pass " ] )
208
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --repeat-until " , " pass " ] )
209
209
#expect( configuration. repetitionPolicy. maximumIterationCount == . max)
210
210
#expect( configuration. repetitionPolicy. continuationCondition == . whileIssueRecorded)
211
211
}
212
212
213
213
@Test ( " --repeat-until fail argument (alone) " )
214
214
@available ( _regexAPI, * )
215
215
func repeatUntilFail( ) throws {
216
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --repeat-until " , " fail " ] )
216
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --repeat-until " , " fail " ] )
217
217
#expect( configuration. repetitionPolicy. maximumIterationCount == . max)
218
218
#expect( configuration. repetitionPolicy. continuationCondition == . untilIssueRecorded)
219
219
}
@@ -222,21 +222,21 @@ struct SwiftPMTests {
222
222
@available ( _regexAPI, * )
223
223
func repeatUntilGarbage( ) {
224
224
#expect( throws: ( any Error ) . self) {
225
- _ = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --repeat-until " , " qwertyuiop " ] )
225
+ _ = try configurationForEntryPoint ( withArguments: [ " PATH " , " --repeat-until " , " qwertyuiop " ] )
226
226
}
227
227
}
228
228
229
229
@Test ( " --repetitions and --repeat-until arguments " )
230
230
@available ( _regexAPI, * )
231
231
func repetitionsAndRepeatUntil( ) throws {
232
- let configuration = try configurationForSwiftPMEntryPoint ( withArguments: [ " PATH " , " --repetitions " , " 2468 " , " --repeat-until " , " pass " ] )
232
+ let configuration = try configurationForEntryPoint ( withArguments: [ " PATH " , " --repetitions " , " 2468 " , " --repeat-until " , " pass " ] )
233
233
#expect( configuration. repetitionPolicy. maximumIterationCount == 2468 )
234
234
#expect( configuration. repetitionPolicy. continuationCondition == . whileIssueRecorded)
235
235
}
236
236
237
237
@Test ( " list subcommand " )
238
238
func list( ) async throws {
239
- let testIDs = await listTestsForSwiftPM ( Test . all)
239
+ let testIDs = await listTestsForEntryPoint ( Test . all)
240
240
let currentTestID = try #require(
241
241
Test . current
242
242
. flatMap ( \. id. parent)
0 commit comments