| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | #!/bin/bashVERSION=$1export PATH=/usr/local/php-$VERSION/bin:$PATHexport C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATHexport CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH# Compile c extensionpushd ../ext/google/protobuf/make clean || trueset -e# Add following in configure for debug: --enable-debug CFLAGS='-g -O0'phpize && ./configure CFLAGS='-g -O0' && makepopdtests=( array_test.php encode_decode_test.php generated_class_test.php map_field_test.php well_known_test.php descriptors_test.php wrapper_type_setters_test.php)for t in "${tests[@]}"do  echo "****************************"  echo "* $t"  echo "****************************"  php -dextension=../ext/google/protobuf/modules/protobuf.so `which 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.phpexport ZEND_DONT_UNLOAD_MODULES=1export USE_ZEND_ALLOC=0valgrind --leak-check=yes php -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# regresssion test.)# for t in "${tests[@]}"# do#   echo "****************************"#   echo "* $t (memory leak)"#   echo "****************************"#   valgrind --leak-check=yes php -dextension=../ext/google/protobuf/modules/protobuf.so `which phpunit` --bootstrap autoload.php $t#   echo ""# done
 |