-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathios_verify.sh
More file actions
executable file
·71 lines (64 loc) · 1.91 KB
/
Copy pathios_verify.sh
File metadata and controls
executable file
·71 lines (64 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
set -euo pipefail
# iOS verification helper.
#
# Usage:
# ./scripts/shell/ios_verify.sh # unit tests only (skips UI tests)
# ./scripts/shell/ios_verify.sh --ui # includes UI tests
include_ui_tests=false
if [[ "${1:-}" == "--ui" ]]; then
include_ui_tests=true
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$REPO_ROOT/native-ios"
echo "==> Selecting an available iPhone simulator..."
SIM_ID="$(
xcrun simctl list devices available -j | python3 -c '
import json, sys
data = json.load(sys.stdin)
for runtime, devices in data.get("devices", {}).items():
if "iOS" not in runtime:
continue
for d in devices:
if d.get("isAvailable") and "iPhone" in d.get("name", ""):
print(d["udid"])
raise SystemExit(0)
raise SystemExit("No available iPhone simulator found")
'
)"
echo "==> Using simulator id: ${SIM_ID}"
echo "==> Build for testing..."
if [[ "${include_ui_tests}" == "false" ]]; then
xcodebuild build-for-testing \
-project RandomTimer.xcodeproj \
-scheme RandomTimer \
-destination "platform=iOS Simulator,id=${SIM_ID}" \
-skip-testing:RandomTimerUITests \
-quiet \
CODE_SIGNING_ALLOWED=NO
else
xcodebuild build-for-testing \
-project RandomTimer.xcodeproj \
-scheme RandomTimer \
-destination "platform=iOS Simulator,id=${SIM_ID}" \
-quiet \
CODE_SIGNING_ALLOWED=NO
fi
echo "==> Run tests..."
if [[ "${include_ui_tests}" == "false" ]]; then
xcodebuild test \
-project RandomTimer.xcodeproj \
-scheme RandomTimer \
-destination "platform=iOS Simulator,id=${SIM_ID}" \
-skip-testing:RandomTimerUITests \
-quiet \
CODE_SIGNING_ALLOWED=NO
else
xcodebuild test \
-project RandomTimer.xcodeproj \
-scheme RandomTimer \
-destination "platform=iOS Simulator,id=${SIM_ID}" \
-quiet \
CODE_SIGNING_ALLOWED=NO
fi