SPB Git

Repository Public

ios-test.sh 1.2 KB 18 lines shellscript

1#!/usr/bin/env bash2# Runs the iOS tests on a dedicated simulator.3#   scripts/ios-test.sh unit [simulator]   hosted unit tests (no network beyond localhost)4#   scripts/ios-test.sh ui [simulator]     UI tests — the search test queries production SP Search (a few provider credits)5set -uo pipefail6cd "$(dirname "$0")/.."7KIND="${1:-unit}"; NAME="${2:-SPBrowser iPhone}"8if ! xcrun simctl list devices available | grep -q "    $NAME ("; then9  TYPE="iPhone 17 Pro"; case "$NAME" in *iPad*) TYPE="com.apple.CoreSimulator.SimDeviceType.iPad-Pro-13-inch-M5-12GB";; esac10  xcrun simctl create "$NAME" "$TYPE" >/dev/null11fi12command -v xcodegen >/dev/null && xcodegen generate --quiet13case "$KIND" in unit) ONLY=SPBrowserMobileTests;; ui) ONLY=SPBrowserMobileUITests;; *) echo "usage: $0 unit|ui [simulator]"; exit 2;; esac14xcodebuild -project SPBrowser.xcodeproj -scheme SPBrowserMobile -configuration Debug -derivedDataPath build/DerivedData-iOS \15  -destination "platform=iOS Simulator,name=$NAME" -only-testing:"$ONLY" test 2>&1 \16  | grep -v "ProcessAssertion" | grep -E "^/.*error:|: error:|Test Case .*(passed|failed)|Executed [0-9]+ tests|TEST (SUCCEEDED|FAILED)|BUILD FAILED" | sed "s|$PWD/||"17exit "${PIPESTATUS[0]}"18
Files main
Menu

Theme