Don’t care about installed protoc in the test scripts

pull/7425/head
Jorge Canizales 9 years ago
parent 4a72356bd3
commit f4df3d2d02
  1. 18
      src/objective-c/tests/build_example_test.sh
  2. 21
      src/objective-c/tests/build_tests.sh
  3. 12
      src/objective-c/tests/run_tests.sh

@ -35,40 +35,22 @@ set -eo pipefail
cd `dirname $0`
BINDIR=`pwd`/../../../bins/$CONFIG
TMP_PATH=$PATH
# If `protoc` is not found, add bins/$CONFIG/protobuf/protoc to the search path
hash protoc 2>/dev/null || TMP_PATH=$BINDIR/protobuf:$TMP_PATH
# If `protoc-gen-objcgrpc` is not found, make a symlink from
# bins/$CONGIF/grpc_objective_c_plugin and add it to the search path
PATH=$TMP_PATH hash protoc-gen-objcgrpc 2>/dev/null || {
ln -sf $BINDIR/grpc_objective_c_plugin $BINDIR/protoc-gen-objcgrpc
TMP_PATH=$BINDIR:$TMP_PATH
}
SCHEME=HelloWorld \
EXAMPLE_PATH=examples/objective-c/helloworld \
PATH=$TMP_PATH \
./build_one_example.sh
SCHEME=RouteGuideClient \
EXAMPLE_PATH=examples/objective-c/route_guide \
PATH=$TMP_PATH \
./build_one_example.sh
SCHEME=AuthSample \
EXAMPLE_PATH=examples/objective-c/auth_sample \
PATH=$TMP_PATH \
./build_one_example.sh
SCHEME=Sample \
EXAMPLE_PATH=src/objective-c/examples/Sample \
PATH=$TMP_PATH \
./build_one_example.sh
SCHEME=SwiftSample \
EXAMPLE_PATH=src/objective-c/examples/SwiftSample \
PATH=$TMP_PATH \
./build_one_example.sh

@ -44,26 +44,5 @@ hash xcodebuild 2>/dev/null || {
exit 1
}
BINDIR=../../../bins/$CONFIG
if [ ! -f $BINDIR/protobuf/protoc ]; then
hash protoc 2>/dev/null || {
echo >&2 "Can't find protoc. Make sure run_tests.py is making" \
"grpc_objective_c_plugin before calling this script."
exit 1
}
# When protoc is already installed, make doesn't compile one. Put a link
# there so the podspecs can do codegen using that path.
mkdir -p $BINDIR/protobuf
ln -s `which protoc` $BINDIR/protobuf/protoc
fi
[ -f $BINDIR/interop_server ] || {
echo >&2 "Can't find the test server. Make sure run_tests.py is making" \
"interop_server before calling this script. It needs to be done" \
"before because pod install of gRPC renames some C gRPC files" \
"and not the server's code references to them."
exit 1
}
pod install

@ -36,8 +36,16 @@ set -e
cd $(dirname $0)
# Run the tests server.
../../../bins/$CONFIG/interop_server --port=5050 &
../../../bins/$CONFIG/interop_server --port=5051 --use_tls &
BINDIR=../../../bins/$CONFIG
[ -f $BINDIR/interop_server ] || {
echo >&2 "Can't find the test server. Make sure run_tests.py is making" \
"interop_server before calling this script."
exit 1
}
$BINDIR/interop_server --port=5050 &
$BINDIR/interop_server --port=5051 --use_tls &
# Kill them when this script exits.
trap 'kill -9 `jobs -p`' EXIT

Loading…
Cancel
Save