From 5c8c87fb7adedb09b758bc4e2012e31a507fbb4d Mon Sep 17 00:00:00 2001 From: Yaojia Wang Date: Sat, 4 Jul 2026 23:00:11 +0200 Subject: [PATCH] chore(ios): add WebTermTests unit-test bundle target (W3 coordination point) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- .../WebTermTestsPlaceholder.swift | 9 ++++++ ios/project.yml | 28 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ios/App/WebTermTests/WebTermTestsPlaceholder.swift diff --git a/ios/App/WebTermTests/WebTermTestsPlaceholder.swift b/ios/App/WebTermTests/WebTermTestsPlaceholder.swift new file mode 100644 index 0000000..7fbf09b --- /dev/null +++ b/ios/App/WebTermTests/WebTermTestsPlaceholder.swift @@ -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-11…14 own their test files here). +@Test("WebTermTests bundle 可加载且能 @testable import WebTerm") +func testBundleLoads() { + #expect(Bool(true)) +} diff --git a/ios/project.yml b/ios/project.yml index 59b7ad9..6299d47 100644 --- a/ios/project.yml +++ b/ios/project.yml @@ -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