test(macos): boost Clawdis coverage to 40%
This commit is contained in:
@@ -7,9 +7,12 @@ extension ProcessInfo {
|
||||
}
|
||||
|
||||
var isRunningTests: Bool {
|
||||
// SwiftPM test bundles are typically loaded from a `.xctest` bundle.
|
||||
// We also check common XCTest env vars because some runners still set them.
|
||||
// SwiftPM tests load one or more `.xctest` bundles. With Swift Testing, `Bundle.main` is not
|
||||
// guaranteed to be the `.xctest` bundle, so check all loaded bundles.
|
||||
if Bundle.allBundles.contains(where: { $0.bundleURL.pathExtension == "xctest" }) { return true }
|
||||
if Bundle.main.bundleURL.pathExtension == "xctest" { return true }
|
||||
|
||||
// Backwards-compatible fallbacks for runners that still set XCTest env vars.
|
||||
return self.environment["XCTestConfigurationFilePath"] != nil
|
||||
|| self.environment["XCTestBundlePath"] != nil
|
||||
|| self.environment["XCTestSessionIdentifier"] != nil
|
||||
|
||||
Reference in New Issue
Block a user