From 5a2a792509af457322b8fc63eff3ec1ee360b0a0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 24 Apr 2017 13:31:20 +0200 Subject: add cmake distribtest --- test/distrib/cpp/run_distrib_test.sh | 37 -------------- test/distrib/cpp/run_distrib_test_cmake.sh | 66 +++++++++++++++++++++++++ test/distrib/cpp/run_distrib_test_routeguide.sh | 37 ++++++++++++++ 3 files changed, 103 insertions(+), 37 deletions(-) delete mode 100755 test/distrib/cpp/run_distrib_test.sh create mode 100755 test/distrib/cpp/run_distrib_test_cmake.sh create mode 100755 test/distrib/cpp/run_distrib_test_routeguide.sh (limited to 'test/distrib') diff --git a/test/distrib/cpp/run_distrib_test.sh b/test/distrib/cpp/run_distrib_test.sh deleted file mode 100755 index b043075d93..0000000000 --- a/test/distrib/cpp/run_distrib_test.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../.. - -cd third_party/protobuf && ./autogen.sh && \ -./configure && make -j4 && make check && make install && ldconfig - -cd ../.. && make -j4 && make install - -cd examples/cpp/helloworld - -make - -make clean - -cd ../../../examples/cpp/route_guide - -make - -make clean - diff --git a/test/distrib/cpp/run_distrib_test_cmake.sh b/test/distrib/cpp/run_distrib_test_cmake.sh new file mode 100755 index 0000000000..a81de57810 --- /dev/null +++ b/test/distrib/cpp/run_distrib_test_cmake.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +cd $(dirname $0)/../../.. + +echo "deb http://ftp.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list +apt-get update +#apt-get install -t jessie-backports -y libc-ares-dev # we need specifically version 1.12 +apt-get install -t jessie-backports -y libssl-dev + +# Install c-ares +cd third_party/cares/cares +git fetch origin +git checkout cares-1_13_0 +mkdir -p cmake/build +cd cmake/build +cmake -DCMAKE_BUILD_TYPE=Release ../.. +make -j4 install +cd ../../../../.. + +# Install zlib +cd third_party/zlib +mkdir -p cmake/build +cd cmake/build +cmake -DCMAKE_BUILD_TYPE=Release ../.. +make -j4 install +cd ../../../.. + +# Install protobuf +cd third_party/protobuf +mkdir -p cmake/build +cd cmake/build +cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release .. +make -j4 install +cd ../../../.. + +# TODO: Install boringssl + +# Install gRPC +mkdir -p cmake/build +cd cmake/build +cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DCMAKE_BUILD_TYPE=Release ../.. +make -j4 install +cd ../.. + +# Build helloworld example using cmake +cd examples/cpp/helloworld +mkdir -p cmake/build +cd cmake/build +cmake ../.. +make + diff --git a/test/distrib/cpp/run_distrib_test_routeguide.sh b/test/distrib/cpp/run_distrib_test_routeguide.sh new file mode 100755 index 0000000000..b043075d93 --- /dev/null +++ b/test/distrib/cpp/run_distrib_test_routeguide.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2016 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +# change to grpc repo root +cd $(dirname $0)/../../.. + +cd third_party/protobuf && ./autogen.sh && \ +./configure && make -j4 && make check && make install && ldconfig + +cd ../.. && make -j4 && make install + +cd examples/cpp/helloworld + +make + +make clean + +cd ../../../examples/cpp/route_guide + +make + +make clean + -- cgit v1.2.3