aboutsummaryrefslogtreecommitdiff
path: root/php/tests/compatibility_test.sh
diff options
context:
space:
mode:
authorYilun Chong <chongyilun250@sina.com>2017-06-30 17:38:50 -0700
committerGitHub <noreply@github.com>2017-06-30 17:38:50 -0700
commite82ba0b8026eb16c40ceba861f02c643c36e8232 (patch)
tree2aa89a917c6091923682221026507aa9eea1aba4 /php/tests/compatibility_test.sh
parent726ba33d98cd06c268f88b7dedf2a9a7916d978d (diff)
parentecca6ea95d56a6f70ff7b223ec3f904758acc8b1 (diff)
downloadprotobuf-e82ba0b8026eb16c40ceba861f02c643c36e8232.tar.gz
protobuf-e82ba0b8026eb16c40ceba861f02c643c36e8232.tar.bz2
protobuf-e82ba0b8026eb16c40ceba861f02c643c36e8232.zip
Merge branch 'master' into ConformanceTestYilunChong
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: