aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/tests/compatibility_test.sh
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-06-30 12:14:09 -0700
committerGravatar GitHub <noreply@github.com>2017-06-30 12:14:09 -0700
commitecca6ea95d56a6f70ff7b223ec3f904758acc8b1 (patch)
tree728f4aff0d5f00c78a741cf737ea6de58f4ba645 /php/tests/compatibility_test.sh
parent5a52b3588d35d2fa0b9ce4eda5630546966a26b4 (diff)
Add json encode/decode for php. (#3226)
* Add json encode/decode for php. * Fix php conformance test on 32-bit machines. * Fix conformance test for c extension. * Fix comments
Diffstat (limited to 'php/tests/compatibility_test.sh')
-rwxr-xr-xphp/tests/compatibility_test.sh34
1 files changed, 32 insertions, 2 deletions
diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh
index e05b2af1..6f1e4900 100755
--- a/php/tests/compatibility_test.sh
+++ b/php/tests/compatibility_test.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-use_php() {
+function use_php() {
VERSION=$1
PHP=`which php`
PHP_CONFIG=`which php-config`
@@ -10,7 +10,7 @@ use_php() {
ln -sfn "/usr/local/php-${VERSION}/bin/phpize" $PHPIZE
}
-generate_proto() {
+function generate_proto() {
PROTOC1=$1
PROTOC2=$2
@@ -25,6 +25,27 @@ generate_proto() {
popd
}
+# Remove tests to expect error. These were added to API tests by mistake.
+function remove_error_test() {
+ local TEMPFILE=`tempfile`
+ cat $1 | \
+ awk -v file=`basename $1` -v dir=`basename $(dirname $1)` '
+ BEGIN {
+ show = 1
+ }
+ /@expectedException PHPUnit_Framework_Error/ { show = 0; next; }
+ / *\*\// { print; next; }
+ / *}/ {
+ if (!show) {
+ show = 1;
+ next;
+ }
+ }
+ show { print }
+ ' > $TEMPFILE
+ cp $TEMPFILE $1
+}
+
set -ex
# Change to the script's directory.
@@ -81,6 +102,15 @@ 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
+
+# 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
+for t in "${tests[@]}"
+do
+ remove_error_test tests/$t
+done
+
cd tests
# Test A.1: