aboutsummaryrefslogtreecommitdiff
path: root/tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh60
1 files changed, 44 insertions, 16 deletions
diff --git a/tests.sh b/tests.sh
index eb8255e1..ce149bc9 100755
--- a/tests.sh
+++ b/tests.sh
@@ -38,11 +38,21 @@ build_cpp() {
make check -j2
cd conformance && make test_cpp && cd ..
- # Verify benchmarking code can build successfully.
- git submodule init
- git submodule update
- cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make && cd ../..
- cd benchmarks && make && ./generate-datasets && cd ..
+ # The benchmark code depends on cmake, so test if it is installed before
+ # trying to do the build.
+ # NOTE: The travis macOS images say they have cmake, but the xcode8.1 image
+ # appears to be missing it: https://github.com/travis-ci/travis-ci/issues/6996
+ if [[ $(type cmake 2>/dev/null) ]]; then
+ # Verify benchmarking code can build successfully.
+ git submodule init
+ git submodule update
+ cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make && cd ../..
+ cd benchmarks && make && ./generate-datasets && cd ..
+ else
+ echo ""
+ echo "WARNING: Skipping validation of the bench marking code, cmake isn't installed."
+ echo ""
+ fi
}
build_cpp_distcheck() {
@@ -89,7 +99,7 @@ build_csharp() {
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update -qq
sudo apt-get install -qq mono-devel referenceassemblies-pcl nunit
-
+
# Then install the dotnet SDK as per Ubuntu 14.04 instructions on dot.net.
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
@@ -265,15 +275,6 @@ build_objectivec_osx() {
}
build_objectivec_cocoapods_integration() {
- # First, load the RVM environment in bash, needed to update ruby.
- source ~/.rvm/scripts/rvm
- # Update rvm to the latest version. This is needed to solve
- # https://github.com/google/protobuf/issues/1786 and may not be needed in the
- # future when Travis updates the default version of rvm.
- rvm get head
- # Update ruby to 2.2.3 as the default one crashes with segmentation faults
- # when using pod.
- rvm use 2.2.3 --install --binary --fuzzy
# Update pod to the latest version.
gem install cocoapods --no-ri --no-rdoc
objectivec/Tests/CocoaPods/run_tests.sh
@@ -327,7 +328,9 @@ build_jruby() {
build_ruby_all() {
build_ruby21
build_ruby22
- build_jruby
+ # TODO(teboring): Disable jruby test temperarily for it randomly fails.
+ # https://grpc-testing.appspot.com/job/protobuf_pull_request/735/consoleFull.
+ # build_jruby
}
build_javascript() {
@@ -335,6 +338,19 @@ build_javascript() {
cd js && npm install && npm test && cd ..
}
+generate_php_test_proto() {
+ internal_build_cpp
+ pushd php/tests
+ # Generate test file
+ rm -rf generated
+ mkdir generated
+ ../../src/protoc --php_out=generated proto/test.proto proto/test_include.proto proto/test_no_namespace.proto
+ pushd ../../src
+ ./protoc --php_out=../php/tests/generated google/protobuf/empty.proto
+ popd
+ popd
+}
+
use_php() {
VERSION=$1
PHP=`which php`
@@ -346,6 +362,7 @@ use_php() {
cp "/usr/bin/php$VERSION" $PHP
cp "/usr/bin/php-config$VERSION" $PHP_CONFIG
cp "/usr/bin/phpize$VERSION" $PHPIZE
+ generate_php_test_proto
}
use_php_zts() {
@@ -356,6 +373,7 @@ use_php_zts() {
ln -sfn "/usr/local/php-${VERSION}-zts/bin/php" $PHP
ln -sfn "/usr/local/php-${VERSION}-zts/bin/php-config" $PHP_CONFIG
ln -sfn "/usr/local/php-${VERSION}-zts/bin/phpize" $PHPIZE
+ generate_php_test_proto
}
use_php_bc() {
@@ -366,13 +384,16 @@ use_php_bc() {
ln -sfn "/usr/local/php-${VERSION}-bc/bin/php" $PHP
ln -sfn "/usr/local/php-${VERSION}-bc/bin/php-config" $PHP_CONFIG
ln -sfn "/usr/local/php-${VERSION}-bc/bin/phpize" $PHPIZE
+ generate_php_test_proto
}
build_php5.5() {
use_php 5.5
+ pushd php
rm -rf vendor
cp -r /usr/local/vendor-5.5 vendor
./vendor/bin/phpunit
+ popd
}
build_php5.5_c() {
@@ -388,9 +409,11 @@ build_php5.5_zts_c() {
build_php5.5_32() {
use_php_bc 5.5
+ pushd php
rm -rf vendor
cp -r /usr/local/vendor-5.5 vendor
./vendor/bin/phpunit
+ popd
}
build_php5.5_c_32() {
@@ -401,9 +424,11 @@ build_php5.5_c_32() {
build_php5.6() {
use_php 5.6
+ pushd php
rm -rf vendor
cp -r /usr/local/vendor-5.6 vendor
./vendor/bin/phpunit
+ popd
}
build_php5.6_c() {
@@ -412,6 +437,7 @@ build_php5.6_c() {
}
build_php5.6_mac() {
+ generate_php_test_proto
# Install PHP
curl -s https://php-osx.liip.ch/install.sh | bash -s 5.6
PHP_FOLDER=`find /usr/local -type d -name "php5-5.6*"` # The folder name may change upon time
@@ -433,9 +459,11 @@ build_php5.6_mac() {
build_php7.0() {
use_php 7.0
+ pushd php
rm -rf vendor
cp -r /usr/local/vendor-7.0 vendor
./vendor/bin/phpunit
+ popd
}
build_php7.0_c() {