diff options
author | Adam Cozzette <acozzette@google.com> | 2018-06-25 13:22:10 -0700 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2018-06-25 13:22:10 -0700 |
commit | 82d3d7d250645322f8a7343188e5ae6246a76414 (patch) | |
tree | 34b7acb87b15c3b8395df3d311f2e795a1285d60 /php/tests/compatibility_test.sh | |
parent | 35567c166842cca3ff6af3226ff526f25c79507f (diff) | |
parent | f7ada1280fac4af717d478e6a9765d3f02b418b3 (diff) |
Merge branch '3.6.x' into merge-3-6-x
Diffstat (limited to 'php/tests/compatibility_test.sh')
-rwxr-xr-x | php/tests/compatibility_test.sh | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh index 7caa46e7..b5b255ea 100755 --- a/php/tests/compatibility_test.sh +++ b/php/tests/compatibility_test.sh @@ -2,12 +2,14 @@ function use_php() { VERSION=$1 - PHP=`which php` - PHP_CONFIG=`which php-config` - PHPIZE=`which phpize` - ln -sfn "/usr/local/php-${VERSION}/bin/php" $PHP - ln -sfn "/usr/local/php-${VERSION}/bin/php-config" $PHP_CONFIG - ln -sfn "/usr/local/php-${VERSION}/bin/phpize" $PHPIZE + + OLD_PATH=$PATH + OLD_CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH + OLD_C_INCLUDE_PATH=$C_INCLUDE_PATH + + export PATH=/usr/local/php-${VERSION}/bin:$OLD_PATH + export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_CPLUS_INCLUDE_PATH + export C_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_C_INCLUDE_PATH } function generate_proto() { @@ -18,7 +20,22 @@ function generate_proto() { mkdir generated $PROTOC1 --php_out=generated proto/test_include.proto - $PROTOC2 --php_out=generated proto/test.proto proto/test_no_namespace.proto proto/test_prefix.proto + $PROTOC2 --php_out=generated \ + proto/test.proto \ + proto/test_no_namespace.proto \ + proto/test_prefix.proto \ + proto/test_php_namespace.proto \ + proto/test_empty_php_namespace.proto \ + proto/test_reserved_enum_lower.proto \ + proto/test_reserved_enum_upper.proto \ + proto/test_reserved_enum_value_lower.proto \ + proto/test_reserved_enum_value_upper.proto \ + proto/test_reserved_message_lower.proto \ + proto/test_reserved_message_upper.proto \ + proto/test_service.proto \ + proto/test_service_namespace.proto \ + proto/test_descriptors.proto + pushd ../../src $PROTOC2 --php_out=../php/tests/generated -I../php/tests -I. ../php/tests/proto/test_import_descriptor_proto.proto popd @@ -52,9 +69,9 @@ cd $(dirname $0) # The old version of protobuf that we are testing compatibility against. case "$1" in - ""|3.3.0) - OLD_VERSION=3.3.0 - OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.3.0/protoc-3.3.0-linux-x86_64.exe + ""|3.5.0) + OLD_VERSION=3.5.0 + OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe ;; *) echo "[ERROR]: Unknown version number: $1" @@ -81,7 +98,7 @@ git checkout v$OLD_VERSION popd # Build and copy the new runtime -use_php 5.5 +use_php 7.1 pushd ../ext/google/protobuf make clean || true phpize && ./configure && make @@ -99,12 +116,12 @@ chmod +x old_protoc NEW_PROTOC=`pwd`/../../src/protoc OLD_PROTOC=`pwd`/old_protoc cd protobuf/php -cp -r /usr/local/vendor-5.5 vendor -wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit +composer install # Remove implementation detail tests. tests=( array_test.php encode_decode_test.php generated_class_test.php map_field_test.php well_known_test.php ) sed -i.bak '/php_implementation_test.php/d' phpunit.xml +sed -i.bak '/generated_phpdoc_test.php/d' phpunit.xml for t in "${tests[@]}" do remove_error_test tests/$t @@ -118,7 +135,7 @@ cd tests generate_proto $OLD_PROTOC $OLD_PROTOC ./test.sh pushd .. -phpunit +./vendor/bin/phpunit popd # Test A.2: @@ -127,7 +144,7 @@ popd generate_proto $NEW_PROTOC $OLD_PROTOC ./test.sh pushd .. -phpunit +./vendor/bin/phpunit popd # Test A.3: @@ -136,5 +153,5 @@ popd generate_proto $OLD_PROTOC $NEW_PROTOC ./test.sh pushd .. -phpunit +./vendor/bin/phpunit popd |