Protocol Buffers - Google's data interchange format (grpc依赖) https://developers.google.com/protocol-buffers/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.1 KiB

#!/bin/bash
De-duplicated code to generate PHP protos and install phpunit. (#7605) * De-duplicated code to generate PHP protos and install phpunit. * Removed all references to generate_php_test_proto. * Replaced with internal_build_cpp. * Make Timestamp::__construct() static to avoid conflicts with MongoDB. * Replicated PHPUnit versions and added new script to Makefile.am. * Fixed filename in Makefile.am. * Disabled test that SEGV's on macOS. * Removed extraneous "set -e". * Make sure generate_protos.sh happens on every test path. * Removed stray '$' chars. * Added proper support for aggregate_metadata tests. But now I get a stack overflow. Stack overflow: /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 namespace GPBMetadata\Proto; class TestDescriptors { public static $is_initialized = false; public static function initOnce() { $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; } \GPBMetadata\Proto\TestDescriptors::initOnce(); $pool->internalAddGeneratedFile(hex2bin( "" ), true); static::$is_initialized = true; } } * Fixed and verified metadata aggregation testing.
5 years ago
set -ex
cd $(dirname $0)
De-duplicated code to generate PHP protos and install phpunit. (#7605) * De-duplicated code to generate PHP protos and install phpunit. * Removed all references to generate_php_test_proto. * Replaced with internal_build_cpp. * Make Timestamp::__construct() static to avoid conflicts with MongoDB. * Replicated PHPUnit versions and added new script to Makefile.am. * Fixed filename in Makefile.am. * Disabled test that SEGV's on macOS. * Removed extraneous "set -e". * Make sure generate_protos.sh happens on every test path. * Removed stray '$' chars. * Added proper support for aggregate_metadata tests. But now I get a stack overflow. Stack overflow: /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 namespace GPBMetadata\Proto; class TestDescriptors { public static $is_initialized = false; public static function initOnce() { $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; } \GPBMetadata\Proto\TestDescriptors::initOnce(); $pool->internalAddGeneratedFile(hex2bin( "" ), true); static::$is_initialized = true; } } * Fixed and verified metadata aggregation testing.
5 years ago
./generate_protos.sh
./compile_extension.sh
De-duplicated code to generate PHP protos and install phpunit. (#7605) * De-duplicated code to generate PHP protos and install phpunit. * Removed all references to generate_php_test_proto. * Replaced with internal_build_cpp. * Make Timestamp::__construct() static to avoid conflicts with MongoDB. * Replicated PHPUnit versions and added new script to Makefile.am. * Fixed filename in Makefile.am. * Disabled test that SEGV's on macOS. * Removed extraneous "set -e". * Make sure generate_protos.sh happens on every test path. * Removed stray '$' chars. * Added proper support for aggregate_metadata tests. But now I get a stack overflow. Stack overflow: /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 namespace GPBMetadata\Proto; class TestDescriptors { public static $is_initialized = false; public static function initOnce() { $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; } \GPBMetadata\Proto\TestDescriptors::initOnce(); $pool->internalAddGeneratedFile(hex2bin( "" ), true); static::$is_initialized = true; } } * Fixed and verified metadata aggregation testing.
5 years ago
PHP_VERSION=$(php -r "echo PHP_VERSION;")
# Each version of PHPUnit supports a fairly narrow range of PHP versions.
case "$PHP_VERSION" in
7.0.*)
PHPUNIT=phpunit-6.phar
;;
7.1.*|7.2.*)
PHPUNIT=phpunit-7.5.0.phar
;;
7.3.*|7.4.*)
PHPUNIT=phpunit-8.phar
;;
8.0.*)
PHPUNIT=phpunit-9.phar
;;
*)
echo "ERROR: Unsupported PHP version $PHP_VERSION"
exit 1
;;
De-duplicated code to generate PHP protos and install phpunit. (#7605) * De-duplicated code to generate PHP protos and install phpunit. * Removed all references to generate_php_test_proto. * Replaced with internal_build_cpp. * Make Timestamp::__construct() static to avoid conflicts with MongoDB. * Replicated PHPUnit versions and added new script to Makefile.am. * Fixed filename in Makefile.am. * Disabled test that SEGV's on macOS. * Removed extraneous "set -e". * Make sure generate_protos.sh happens on every test path. * Removed stray '$' chars. * Added proper support for aggregate_metadata tests. But now I get a stack overflow. Stack overflow: /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 namespace GPBMetadata\Proto; class TestDescriptors { public static $is_initialized = false; public static function initOnce() { $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; } \GPBMetadata\Proto\TestDescriptors::initOnce(); $pool->internalAddGeneratedFile(hex2bin( "" ), true); static::$is_initialized = true; } } * Fixed and verified metadata aggregation testing.
5 years ago
esac
[ -f $PHPUNIT ] || wget https://phar.phpunit.de/$PHPUNIT
tests=( ArrayTest.php EncodeDecodeTest.php GeneratedClassTest.php MapFieldTest.php WellKnownTest.php DescriptorsTest.php WrapperTypeSettersTest.php)
for t in "${tests[@]}"
do
echo "****************************"
echo "* $t"
echo "****************************"
De-duplicated code to generate PHP protos and install phpunit. (#7605) * De-duplicated code to generate PHP protos and install phpunit. * Removed all references to generate_php_test_proto. * Replaced with internal_build_cpp. * Make Timestamp::__construct() static to avoid conflicts with MongoDB. * Replicated PHPUnit versions and added new script to Makefile.am. * Fixed filename in Makefile.am. * Disabled test that SEGV's on macOS. * Removed extraneous "set -e". * Make sure generate_protos.sh happens on every test path. * Removed stray '$' chars. * Added proper support for aggregate_metadata tests. But now I get a stack overflow. Stack overflow: /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 namespace GPBMetadata\Proto; class TestDescriptors { public static $is_initialized = false; public static function initOnce() { $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; } \GPBMetadata\Proto\TestDescriptors::initOnce(); $pool->internalAddGeneratedFile(hex2bin( "" ), true); static::$is_initialized = true; } } * Fixed and verified metadata aggregation testing.
5 years ago
php -dextension=../ext/google/protobuf/modules/protobuf.so $PHPUNIT --bootstrap autoload.php $t
echo ""
done
for t in "${tests[@]}"
do
echo "****************************"
echo "* $t persistent"
echo "****************************"
De-duplicated code to generate PHP protos and install phpunit. (#7605) * De-duplicated code to generate PHP protos and install phpunit. * Removed all references to generate_php_test_proto. * Replaced with internal_build_cpp. * Make Timestamp::__construct() static to avoid conflicts with MongoDB. * Replicated PHPUnit versions and added new script to Makefile.am. * Fixed filename in Makefile.am. * Disabled test that SEGV's on macOS. * Removed extraneous "set -e". * Make sure generate_protos.sh happens on every test path. * Removed stray '$' chars. * Added proper support for aggregate_metadata tests. But now I get a stack overflow. Stack overflow: /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 namespace GPBMetadata\Proto; class TestDescriptors { public static $is_initialized = false; public static function initOnce() { $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; } \GPBMetadata\Proto\TestDescriptors::initOnce(); $pool->internalAddGeneratedFile(hex2bin( "" ), true); static::$is_initialized = true; } } * Fixed and verified metadata aggregation testing.
5 years ago
php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so $PHPUNIT --bootstrap autoload.php $t
echo ""
done
# # Make sure to run the memory test in debug mode.
# php -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php
export ZEND_DONT_UNLOAD_MODULES=1
export USE_ZEND_ALLOC=0
valgrind --suppressions=valgrind.supp --leak-check=yes php -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php
valgrind --suppressions=valgrind.supp --leak-check=yes php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php
# TODO(teboring): Only for debug (phpunit has memory leak which blocks this beging used by
# regression test.)
# for t in "${tests[@]}"
# do
# echo "****************************"
# echo "* $t (memory leak)"
# echo "****************************"
De-duplicated code to generate PHP protos and install phpunit. (#7605) * De-duplicated code to generate PHP protos and install phpunit. * Removed all references to generate_php_test_proto. * Replaced with internal_build_cpp. * Make Timestamp::__construct() static to avoid conflicts with MongoDB. * Replicated PHPUnit versions and added new script to Makefile.am. * Fixed filename in Makefile.am. * Disabled test that SEGV's on macOS. * Removed extraneous "set -e". * Make sure generate_protos.sh happens on every test path. * Removed stray '$' chars. * Added proper support for aggregate_metadata tests. But now I get a stack overflow. Stack overflow: /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 /Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16 namespace GPBMetadata\Proto; class TestDescriptors { public static $is_initialized = false; public static function initOnce() { $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; } \GPBMetadata\Proto\TestDescriptors::initOnce(); $pool->internalAddGeneratedFile(hex2bin( "" ), true); static::$is_initialized = true; } } * Fixed and verified metadata aggregation testing.
5 years ago
# valgrind --leak-check=yes php -dextension=../ext/google/protobuf/modules/protobuf.so $PHPUNIT --bootstrap autoload.php $t
# echo ""
# done