-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·76 lines (70 loc) · 2.32 KB
/
run_tests.sh
File metadata and controls
executable file
·76 lines (70 loc) · 2.32 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
72
73
74
75
76
#!/bin/bash
set -e
# FastComments iOS — Run All Tests
#
# Usage:
# ./run_tests.sh # Run everything
# ./run_tests.sh sdk # SDK integration tests only
# ./run_tests.sh ui # Single-simulator UI tests only
# ./run_tests.sh dual # Dual-simulator live event tests only
DEST='platform=iOS Simulator,name=iPhone 16,OS=latest'
PROJECT="ExampleApp/FastCommentsExample.xcodeproj"
SCHEME="FastCommentsExample"
run_sdk() {
echo "=========================================="
echo " SDK Integration Tests (84 tests)"
echo "=========================================="
xcodebuild test \
-scheme FastCommentsUI \
-destination "$DEST" \
2>&1 | grep -E 'Test Case|Executed.*tests|SUCCEEDED|FAILED'
echo ""
}
run_ui() {
echo "=========================================="
echo " Single-Simulator UI Tests"
echo "=========================================="
cd ExampleApp && /opt/homebrew/bin/xcodegen generate 2>&1 | tail -1 && cd ..
xcodebuild test \
-project "$PROJECT" \
-scheme "$SCHEME" \
-destination "$DEST" \
-skip-testing FastCommentsUITests/LiveEventUserA_UITests \
-skip-testing FastCommentsUITests/LiveEventUserB_UITests \
-skip-testing FastCommentsUITests/FeedUserA_UITests \
-skip-testing FastCommentsUITests/FeedUserB_UITests \
2>&1 | grep -E 'Test Case|Executed.*tests|SUCCEEDED|FAILED'
echo ""
}
run_dual() {
echo "=========================================="
echo " Dual-Simulator Live Event Tests"
echo "=========================================="
echo " Requires two booted simulators."
echo " Check: xcrun simctl list devices booted"
echo "=========================================="
cd ExampleApp
/opt/homebrew/bin/xcodegen generate 2>&1 | tail -1
lsof -ti :9999 | xargs kill -9 2>/dev/null || true
sleep 1
python3 run_dual_sim_tests.py
cd ..
echo ""
}
case "${1:-all}" in
sdk) run_sdk ;;
ui) run_ui ;;
dual) run_dual ;;
all)
run_sdk
run_ui
run_dual
echo "=========================================="
echo " ALL TEST SUITES COMPLETE"
echo "=========================================="
;;
*)
echo "Usage: $0 [sdk|ui|dual|all]"
exit 1
;;
esac