chore(ios): add WebTermTests unit-test bundle target (W3 coordination point)

project.yml gains a bundle.unit-test target hosted by the app, wired to all
5 local packages (TestSupport test-doubles included) so T-iOS-11..14 VM tests
run via xcodebuild test. Coverage gate still counts only the 4 packages (§9).
This commit is contained in:
Yaojia Wang
2026-07-04 23:00:11 +02:00
parent a2b14ab6e7
commit 5c8c87fb7a
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import Testing
@testable import WebTerm
// Orchestrator-added placeholder so the WebTermTests bundle compiles before
// W3 lands real ViewModel tests (T-iOS-1114 own their test files here).
@Test("WebTermTests bundle 可加载且能 @testable import WebTerm")
func testBundleLoads() {
#expect(Bool(true))
}

View File

@@ -31,6 +31,8 @@ packages:
path: Packages/HostRegistry
APIClient:
path: Packages/APIClient
TestSupport:
path: Packages/TestSupport # test doubles — WebTermTests only, never the app target
# SwiftTerm is the ONLY third-party dependency, attached to the App target
# ONLY (plan §2) — packages must never import it.
SwiftTerm:
@@ -82,12 +84,38 @@ targets:
NSLocalNetworkUsageDescription: "连接你自己电脑上的 web-terminal 服务器"
NSCameraUsageDescription: "扫描 web 终端的配对二维码"
# Unit-test bundle for App-target logic (ViewModels & pure UI components,
# W3 T-iOS-11…14). Added by the orchestrator as a coordination point
# (project.yml is T-iOS-1's Owns; same precedent as the W1 manifest wiring).
# Coverage GATE still counts only the 4 packages (plan §9) — these tests
# exist for correctness, not for the gate.
WebTermTests:
type: bundle.unit-test
platform: iOS
sources:
- App/WebTermTests
dependencies:
- target: WebTerm
- package: WireProtocol
- package: SessionCore
- package: HostRegistry
- package: APIClient
- package: TestSupport
settings:
base:
GENERATE_INFOPLIST_FILE: true
TEST_HOST: "$(BUILT_PRODUCTS_DIR)/WebTerm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/WebTerm"
BUNDLE_LOADER: "$(TEST_HOST)"
schemes:
WebTerm:
build:
targets:
WebTerm: all
WebTermTests: [test]
run:
config: Debug
test:
config: Debug
targets:
- WebTermTests