SPB Git

Repository Public

DevHarness.swift 1.1 KB 20 lines swift

1// Author: Simon-Pierre Boucher — contact@spboucher.ai2// File: App/DevHarness.swift3// Description: DEVELOPMENT VARIANT ONLY (not compiled in Release): launch arguments that drive the app against the local throwaway stack for visual checks and scripted end-to-end runs. -spwAutoSetup YES enrols or signs in the software passkey; -spwSection <name> opens a section; -spwSelfTest YES runs the scripted checks and writes their result in the app's container.4#if SPW_DEV5import Foundation6import SPWalletCore78@MainActor enum DevHarness {9    static func run(model: AppModel, nav: Navigator) async {10        let d = UserDefaults.standard11        if d.bool(forKey: "spwAutoSetup") {12            if model.phase == .setupRequired, let t = d.string(forKey: "spwDevSetupToken") { await model.devSetup(token: t) }13            else if model.phase == .signedOut { await model.signIn() }14        }15        if let s = d.string(forKey: "spwSection"), let sec = Section(rawValue: s) { nav.section = sec }16        if d.bool(forKey: "spwSelfTest") { await DevSelfTest.run(model: model) }17    }18}19#endif20
Files main
Menu

Theme