• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright 2019 gRPC authors.
3#
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
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15
16# Don't run this script standalone. Instead, run from the repository root:
17# ./tools/run_tests/run_tests.py -l objc
18
19# TODO(tonyzhehaolu):
20# For future use when Xcode is upgraded and tvos_unit_test is fully functional
21
22set -ev
23
24cd $(dirname $0)
25
26BAZEL=../../../tools/bazel
27
28INTEROP=../../../bazel-out/darwin-fastbuild/bin/test/cpp/interop/interop_server
29
30[ -d Tests.xcworkspace ] || {
31    ./build_tests.sh
32}
33
34[ -f $INTEROP ] || {
35    BAZEL build //test/cpp/interop:interop_server
36}
37
38[ -z "$(ps aux |egrep 'port_server\.py.*-p\s32766')" ] && {
39    echo >&2 "Can't find the port server. Start port server with tools/run_tests/start_port_server.py."
40    exit 1
41}
42
43PLAIN_PORT=$(curl localhost:32766/get)
44TLS_PORT=$(curl localhost:32766/get)
45
46$INTEROP --port=$PLAIN_PORT --max_send_message_size=8388608 &
47$INTEROP --port=$TLS_PORT --max_send_message_size=8388608 --use_tls &
48
49trap 'kill -9 `jobs -p` ; echo "EXIT TIME:  $(date)"' EXIT
50
51../../../tools/bazel run $SCHEME
52