File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 23
23
/// }
24
24
///
25
25
/// To detect if the current task is running inside a test, use ``TestContext/current``, instead.
26
- public let isTesting = ProcessInfo . processInfo. isTesting // TODO: || TestContext.current != nil
26
+ public let isTesting = ProcessInfo . processInfo. isTesting
27
27
28
28
private extension ProcessInfo {
29
29
var isTesting : Bool {
30
30
if environment. keys. contains ( " XCTestBundlePath " ) { return true }
31
31
if environment. keys. contains ( " XCTestConfigurationFilePath " ) { return true }
32
32
if environment. keys. contains ( " XCTestSessionIdentifier " ) { return true }
33
- if let argument = arguments. first {
33
+ return arguments. contains { argument in
34
34
let path = URL ( fileURLWithPath: argument)
35
- if path. lastPathComponent == " xctest " { return true }
35
+ return path. lastPathComponent == " xctest " || path . pathExtension == " xctest "
36
36
}
37
- if let argument = arguments. last {
38
- let path = URL ( fileURLWithPath: argument)
39
- if path. pathExtension == " xctest " { return true }
40
- }
41
- return false
42
37
}
43
38
}
44
39
#endif
You can’t perform that action at this time.
0 commit comments