2 # Copyright 2015 gRPC authors.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # Don't run this script standalone. Instead, run from the repository root:
17 # ./tools/run_tests/run_tests.py -l objc
23 # Run the tests server.
25 BINDIR=../../../bins/$CONFIG
27 [ -f $BINDIR/interop_server ] || {
28 echo >&2 "Can't find the test server. Make sure run_tests.py is making" \
29 "interop_server before calling this script."
32 $BINDIR/interop_server --port=5050 --max_send_message_size=8388608 &
33 $BINDIR/interop_server --port=5051 --max_send_message_size=8388608 --use_tls &
34 # Kill them when this script exits.
35 trap 'kill -9 `jobs -p` ; echo "EXIT TIME: $(date)"' EXIT
39 # xcodebuild is very verbose. We filter its output and tell Bash to fail if any
40 # element of the pipe fails.
41 # TODO(jcanizales): Use xctool instead? Issue #2540.
42 XCODEBUILD_FILTER='(^CompileC |^Ld |^ *[^ ]*clang |^ *cd |^ *export |^Libtool |^ *[^ ]*libtool |^CpHeader |^ *builtin-copy )'
46 # Retry the test for up to 3 times when return code is 65, due to Xcode issue:
47 # http://www.openradar.me/29785686
48 # The issue seems to be a connectivity issue to Xcode simulator so only retry
49 # the first xcodebuild command
51 while [ $retries -lt 3 ]; do
54 -workspace Tests.xcworkspace \
56 -destination name="iPhone 8" \
57 HOST_PORT_LOCALSSL=localhost:5051 \
58 HOST_PORT_LOCAL=localhost:5050 \
59 HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
61 | egrep -v "$XCODEBUILD_FILTER" \
63 | egrep -v "(GPBDictionary|GPBArray)" - ) || return_code=$?
64 if [ $return_code == 65 ] && [[ $out == *"DTXProxyChannel error 1"* ]]; then
66 echo "Failed with code 65 (DTXProxyChannel error 1); retry."
67 retries=$(($retries+1))
68 elif [ $return_code == 0 ]; then
73 echo "Failed with code $return_code."
77 if [ $retries == 3 ]; then
78 echo "Failed with code 65 for 3 times; abort."
84 -workspace Tests.xcworkspace \
85 -scheme CoreCronetEnd2EndTests \
86 -destination name="iPhone 8" \
88 | egrep -v "$XCODEBUILD_FILTER" \
90 | egrep -v "(GPBDictionary|GPBArray)" -
94 -workspace Tests.xcworkspace \
95 -scheme CoreCronetEnd2EndTests_Asan \
96 -destination name="iPhone 6" \
98 | egrep -v "$XCODEBUILD_FILTER" \
100 | egrep -v "(GPBDictionary|GPBArray)" -
104 -workspace Tests.xcworkspace \
105 -scheme CoreCronetEnd2EndTests_Tsan \
106 -destination name="iPhone 6" \
108 | egrep -v "$XCODEBUILD_FILTER" \
110 | egrep -v "(GPBDictionary|GPBArray)" -
114 -workspace Tests.xcworkspace \
115 -scheme CronetUnitTests \
116 -destination name="iPhone 8" \
118 | egrep -v "$XCODEBUILD_FILTER" \
120 | egrep -v "(GPBDictionary|GPBArray)" -
124 -workspace Tests.xcworkspace \
125 -scheme InteropTestsRemoteWithCronet \
126 -destination name="iPhone 8" \
127 HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
129 | egrep -v "$XCODEBUILD_FILTER" \
131 | egrep -v "(GPBDictionary|GPBArray)" -
135 -workspace Tests.xcworkspace \
136 -scheme InteropTestsRemoteCFStream \
137 -destination name="iPhone 8" \
138 HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
140 | egrep -v "$XCODEBUILD_FILTER" \
142 | egrep -v "(GPBDictionary|GPBArray)" -
146 -workspace Tests.xcworkspace \
147 -scheme InteropTestsLocalCleartextCFStream \
148 -destination name="iPhone 8" \
149 HOST_PORT_LOCAL=localhost:5050 \
151 | egrep -v "$XCODEBUILD_FILTER" \
153 | egrep -v "(GPBDictionary|GPBArray)" -
157 -workspace Tests.xcworkspace \
158 -scheme InteropTestsLocalSSLCFStream \
159 -destination name="iPhone 8" \
160 HOST_PORT_LOCALSSL=localhost:5051 \
162 | egrep -v "$XCODEBUILD_FILTER" \
164 | egrep -v "(GPBDictionary|GPBArray)" -
168 -workspace Tests.xcworkspace \
170 -destination name="iPhone 8" \
172 | egrep -v "$XCODEBUILD_FILTER" \
174 | egrep -v "(GPBDictionary|GPBArray)" -
178 -workspace Tests.xcworkspace \
179 -scheme ChannelTests \
180 -destination name="iPhone 8" \
182 | egrep -v "$XCODEBUILD_FILTER" \
184 | egrep -v "(GPBDictionary|GPBArray)" -
188 -workspace Tests.xcworkspace \
190 -destination name="iPhone 8" \
191 HOST_PORT_LOCAL=localhost:5050 \
192 HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
194 | egrep -v "$XCODEBUILD_FILTER" \
196 | egrep -v "(GPBDictionary|GPBArray)" -
200 -workspace Tests.xcworkspace \
202 -destination platform=macOS \
203 HOST_PORT_LOCALSSL=localhost:5051 \
204 HOST_PORT_LOCAL=localhost:5050 \
205 HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
207 | egrep -v "$XCODEBUILD_FILTER" \
209 | egrep -v "(GPBDictionary|GPBArray)" -