aboutsummaryrefslogtreecommitdiff
path: root/tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh73
1 files changed, 69 insertions, 4 deletions
diff --git a/tests.sh b/tests.sh
index ce149bc9..2553df71 100755
--- a/tests.sh
+++ b/tests.sh
@@ -62,7 +62,8 @@ build_cpp_distcheck() {
# List all files that should be included in the distribution package.
git ls-files | grep "^\(java\|python\|objectivec\|csharp\|js\|ruby\|php\|cmake\|examples\)" |\
- grep -v ".gitignore" | grep -v "java/compatibility_tests" > dist.lst
+ grep -v ".gitignore" | grep -v "java/compatibility_tests" |\
+ grep -v "python/compatibility_tests" | grep -v "csharp/compatibility_tests" > dist.lst
# Unzip the dist tar file.
DIST=`ls *.tar.gz`
tar -xf $DIST
@@ -118,6 +119,9 @@ build_csharp() {
(cd csharp/src; dotnet restore)
csharp/buildall.sh
cd conformance && make test_csharp && cd ..
+
+ # Run csharp compatibility test between 3.0.0 and the current version.
+ csharp/compatibility_tests/v3.0.0/test.sh 3.0.0
}
build_golang() {
@@ -311,6 +315,16 @@ build_python_cpp() {
cd ..
}
+build_python_compatibility() {
+ internal_build_cpp
+ # Use the unit-tests extraced from 2.5.0 to test the compatibilty.
+ cd python/compatibility_tests/v2.5.0
+ # Test between 2.5.0 and the current version.
+ ./test.sh 2.5.0
+ # Test between 3.0.0-beta-1 and the current version.
+ ./test.sh 3.0.0-beta-1
+}
+
build_ruby21() {
internal_build_cpp # For conformance tests.
cd ruby && bash travis-test.sh ruby-2.1 && cd ..
@@ -388,23 +402,48 @@ use_php_bc() {
}
build_php5.5() {
- use_php 5.5
+ PHP=`which php`
+ PHP_CONFIG=`which php-config`
+ PHPIZE=`which phpize`
+ ln -sfn "/usr/local/php-5.5/bin/php" $PHP
+ ln -sfn "/usr/local/php-5.5/bin/php-config" $PHP_CONFIG
+ ln -sfn "/usr/local/php-5.5/bin/phpize" $PHPIZE
+ generate_php_test_proto
+
pushd php
rm -rf vendor
cp -r /usr/local/vendor-5.5 vendor
./vendor/bin/phpunit
popd
+ pushd conformance
+ # TODO(teboring): Add it back
+ # make test_php
+ popd
}
build_php5.5_c() {
- use_php 5.5
+ PHP=`which php`
+ PHP_CONFIG=`which php-config`
+ PHPIZE=`which phpize`
+ ln -sfn "/usr/local/php-5.5/bin/php" $PHP
+ ln -sfn "/usr/local/php-5.5/bin/php-config" $PHP_CONFIG
+ ln -sfn "/usr/local/php-5.5/bin/phpize" $PHPIZE
+ generate_php_test_proto
+ wget https://phar.phpunit.de/phpunit-old.phar -O /usr/bin/phpunit
+
cd php/tests && /bin/bash ./test.sh && cd ../..
+ pushd conformance
+ make test_php_c
+ popd
}
build_php5.5_zts_c() {
use_php_zts 5.5
wget https://phar.phpunit.de/phpunit-old.phar -O /usr/bin/phpunit
cd php/tests && /bin/bash ./test.sh && cd ../..
+ pushd conformance
+ make test_php_c
+ popd
}
build_php5.5_32() {
@@ -414,12 +453,20 @@ build_php5.5_32() {
cp -r /usr/local/vendor-5.5 vendor
./vendor/bin/phpunit
popd
+ # TODO(teboring): Add conformance test.
+ # pushd conformance
+ # make test_php
+ # popd
}
build_php5.5_c_32() {
use_php_bc 5.5
wget https://phar.phpunit.de/phpunit-old.phar -O /usr/bin/phpunit
cd php/tests && /bin/bash ./test.sh && cd ../..
+ # TODO(teboring): Add conformance test.
+ # pushd conformance
+ # make test_php_c
+ # popd
}
build_php5.6() {
@@ -429,11 +476,18 @@ build_php5.6() {
cp -r /usr/local/vendor-5.6 vendor
./vendor/bin/phpunit
popd
+ pushd conformance
+ # TODO(teboring): Add it back
+ # make test_php
+ popd
}
build_php5.6_c() {
use_php 5.6
cd php/tests && /bin/bash ./test.sh && cd ../..
+ pushd conformance
+ make test_php_c
+ popd
}
build_php5.6_mac() {
@@ -444,7 +498,7 @@ build_php5.6_mac() {
export PATH="$PHP_FOLDER/bin:$PATH"
# Install phpunit
- curl https://phar.phpunit.de/phpunit.phar -L -o phpunit.phar
+ curl https://phar.phpunit.de/phpunit-5.6.10.phar -L -o phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
@@ -455,6 +509,9 @@ build_php5.6_mac() {
# Test
cd php/tests && /bin/bash ./test.sh && cd ../..
+ pushd conformance
+ make test_php_c
+ popd
}
build_php7.0() {
@@ -464,11 +521,18 @@ build_php7.0() {
cp -r /usr/local/vendor-7.0 vendor
./vendor/bin/phpunit
popd
+ pushd conformance
+ # TODO(teboring): Add it back
+ # make test_php
+ popd
}
build_php7.0_c() {
use_php 7.0
cd php/tests && /bin/bash ./test.sh && cd ../..
+ pushd conformance
+ make test_php_c
+ popd
}
build_php_all() {
@@ -513,6 +577,7 @@ Usage: $0 { cpp |
objectivec_cocoapods_integration |
python |
python_cpp |
+ python_compatibility |
ruby21 |
ruby22 |
jruby |