#!/bin/bash # 在只有 Command Line Tools 的机器上编译并运行 iOS 核心层测试。 # # 核心层刻意不 import UIKit/AVFoundation,因此可以直接以 macOS 为目标编译, # 在没有 Xcode / 没有模拟器的环境里也能验证协议、发现与传输逻辑。 set -euo pipefail cd "$(dirname "$0")/.." OUT="$(mktemp -d)" trap 'rm -rf "$OUT"' EXIT echo "== 编译 ==" swiftc -swift-version 5 -O \ QFT/Core/*.swift CoreTests/*.swift \ -o "$OUT/qft-core-tests" echo "== 运行 ==" "$OUT/qft-core-tests" "$OUT"