mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-25 19:20:00 +02:00
b4fe510648
Closes the gap from prior commits where E2E tests stubbed the Swift StateServer in TypeScript. Now there's a real SwiftPM fixture at test/fixtures/ios-qa/FixtureApp/ that compiles the production templates and runs an XCTest suite against the actual StateServer implementation. Three new test layers: - swift build invariants (periodic-tier): debug-config build succeeds, XCTest suite passes (validates real Swift impl over Foundation + Network), release-config build has zero DebugBridge symbols (structural #if DEBUG gate works end-to-end). - Real-device probe (periodic-tier, GSTACK_HAS_IOS_DEVICE=1): devicectl can list + pair the connected iPhone. Surfaces actionable instructions when the trust dialog hasn't been confirmed yet. - Fixture sources copied from ios-qa/templates/ — Package.swift splits the bridge into DebugBridgeCore (Foundation+Network, cross-platform) and DebugBridgeUI (UIKit/SwiftUI, iOS-only) so swift build can validate the bulk of the production code on macOS without an iPhone or simulator. Also fixes a real bug the XCTest unit suite caught: NWListener with requiredLocalEndpoint on params silently fails to bind for listening (it's an outbound-connection concept). Replaced with .requiredInterfaceType=.loopback + .acceptLocalOnly=true + a per-connection peer-address check. The fork's inherited code had this bug; we shipped it untouched in v1.41.0.0 and the new XCTest suite caught it immediately.
42 lines
1.2 KiB
Swift
42 lines
1.2 KiB
Swift
// swift-tools-version:5.9
|
|
// Test fixture: minimal SwiftUI app + DebugBridge SPM package.
|
|
// DebugBridgeCore (Foundation+Network) builds cross-platform.
|
|
// DebugBridgeUI (UIKit/SwiftUI) is iOS-only.
|
|
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "FixtureApp",
|
|
platforms: [
|
|
.iOS(.v16),
|
|
.macOS(.v13),
|
|
],
|
|
products: [
|
|
.library(name: "DebugBridgeCore", targets: ["DebugBridgeCore"]),
|
|
.library(name: "DebugBridgeUI", targets: ["DebugBridgeUI"]),
|
|
],
|
|
targets: [
|
|
.target(
|
|
name: "DebugBridgeCore",
|
|
dependencies: [],
|
|
path: "Sources/DebugBridgeCore",
|
|
swiftSettings: [
|
|
.define("DEBUG", .when(configuration: .debug)),
|
|
]
|
|
),
|
|
.target(
|
|
name: "DebugBridgeUI",
|
|
dependencies: ["DebugBridgeCore"],
|
|
path: "Sources/DebugBridgeUI",
|
|
swiftSettings: [
|
|
.define("DEBUG", .when(configuration: .debug)),
|
|
]
|
|
),
|
|
.testTarget(
|
|
name: "DebugBridgeCoreTests",
|
|
dependencies: ["DebugBridgeCore"],
|
|
path: "Tests/DebugBridgeCoreTests"
|
|
),
|
|
]
|
|
)
|