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.pull/7613/head
parent
9f546ba61b
commit
f1ce8663ac
9 changed files with 74 additions and 73 deletions
@ -0,0 +1,16 @@ |
||||
#!/bin/bash |
||||
|
||||
set -ex |
||||
|
||||
cd `dirname $0` |
||||
|
||||
rm -rf generated |
||||
mkdir -p generated |
||||
|
||||
find proto -type f -name "*.proto"| xargs ../../src/protoc --php_out=generated -I../../src -I. |
||||
|
||||
if [ "$1" = "--aggregate_metadata" ]; then |
||||
# Overwrite some of the files to use aggregation. |
||||
AGGREGATED_FILES="proto/test.proto proto/test_include.proto proto/test_import_descriptor_proto.proto" |
||||
../../src/protoc --php_out=aggregate_metadata=foo#bar:generated -I../../src -I. $AGGREGATED_FILES |
||||
fi |
Loading…
Reference in new issue