forked from getsentry/sentry-cocoa
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathxcode-test.sh
executable file
·69 lines (56 loc) · 2.04 KB
/
xcode-test.sh
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
#!/bin/bash
set -uox pipefail
# This is a helper script for GitHub Actions Matrix.
# If we would specify the destinations in the GitHub Actions
# Matrix, the name of the job would include the destination, which would
# be, for example, platform=tvOS Simulator,OS=latest,name=Apple TV 4K.
# To fix this, we specify a readable platform in the matrix and then call
# this script to map the platform to the destination.
PLATFORM="${1}"
OS=${2:-latest}
XCODE="${3}"
REF_NAME="${4}"
DESTINATION=""
CONFIGURATION=""
case $PLATFORM in
"macOS")
DESTINATION="platform=macOS"
;;
"Catalyst")
DESTINATION="platform=macOS,variant=Mac Catalyst"
;;
"iOS")
DESTINATION="platform=iOS Simulator,OS=$OS,name=iPhone 8"
;;
"tvOS")
DESTINATION="platform=tvOS Simulator,OS=$OS,name=Apple TV"
;;
*)
echo "Xcode Test: Can't find destination for platform '$PLATFORM'";
exit 1;
;;
esac
echo "REF_NAME: $REF_NAME"
case $REF_NAME in
"master")
CONFIGURATION="TestCI"
;;
*)
CONFIGURATION="Test"
;;
esac
echo "CONFIGURATION: $CONFIGURATION"
if [ $PLATFORM == "iOS" -a $OS == "12.4" ]; then
# Skip some tests that fail on iOS 12.4.
env NSUnbufferedIO=YES xcodebuild -workspace Sentry.xcworkspace \
-scheme Sentry -configuration $CONFIGURATION \
GCC_GENERATE_TEST_COVERAGE_FILES=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES -destination "$DESTINATION" \
-skip-testing:"SentryTests/SentrySDKTests/testMemoryFootprintOfAddingBreadcrumbs" \
-skip-testing:"SentryTests/SentrySDKTests/testMemoryFootprintOfTransactions" \
test | tee raw-test-output.log | xcpretty -t && exit ${PIPESTATUS[0]}
else
env NSUnbufferedIO=YES xcodebuild -workspace Sentry.xcworkspace \
-scheme Sentry -configuration $CONFIGURATION \
GCC_GENERATE_TEST_COVERAGE_FILES=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES -destination "$DESTINATION" \
test | tee raw-test-output.log | xcpretty -t && exit ${PIPESTATUS[0]}
fi