mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Added custom enviroment flags for unit and UI tests.
This commit is contained in:
@@ -13,8 +13,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
private var appCoordinator: AppCoordinator!
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
||||
if isRunningUnitTests {
|
||||
return true
|
||||
}
|
||||
|
||||
if isRunningUITests {
|
||||
// Bootstrap a different version of the application
|
||||
return true
|
||||
}
|
||||
|
||||
appCoordinator = AppCoordinator()
|
||||
appCoordinator.start()
|
||||
return true
|
||||
}
|
||||
|
||||
private var isRunningUnitTests: Bool {
|
||||
#if DEBUG
|
||||
ProcessInfo.processInfo.environment["IS_RUNNING_UNIT_TESTS"] == "1"
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
}
|
||||
|
||||
private var isRunningUITests: Bool {
|
||||
#if DEBUG
|
||||
ProcessInfo.processInfo.environment["IS_RUNNING_UI_TESTS"] == "1"
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
name: ElementX
|
||||
|
||||
schemes:
|
||||
ElementX:
|
||||
analyze:
|
||||
config: Debug
|
||||
archive:
|
||||
config: Release
|
||||
build:
|
||||
targets:
|
||||
ElementX:
|
||||
- running
|
||||
- testing
|
||||
- profiling
|
||||
- analyzing
|
||||
- archiving
|
||||
profile:
|
||||
config: Release
|
||||
run:
|
||||
config: Debug
|
||||
test:
|
||||
config: Debug
|
||||
environmentVariables:
|
||||
IS_RUNNING_UNIT_TESTS: "1"
|
||||
targets:
|
||||
- UnitTests
|
||||
- UITests
|
||||
|
||||
targets:
|
||||
ElementX:
|
||||
type: application
|
||||
@@ -34,12 +60,6 @@ targets:
|
||||
else
|
||||
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
|
||||
fi
|
||||
|
||||
scheme:
|
||||
gatherCoverageData: true
|
||||
testTargets:
|
||||
- UnitTests
|
||||
- UITests
|
||||
|
||||
dependencies:
|
||||
- package: MatrixRustSDK
|
||||
|
||||
Reference in New Issue
Block a user