test.sh 850 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # Generate test file
  3. ../../src/protoc --php_out=. test.proto test_include.proto
  4. # Compile c extension
  5. pushd ../ext/google/protobuf/
  6. make clean
  7. set -e
  8. # Add following in configure for debug: --enable-debug CFLAGS='-g -O0'
  9. phpize && ./configure && make
  10. popd
  11. tests=( array_test.php encode_decode_test.php generated_class_test.php map_field_test.php well_known_test.php )
  12. for t in "${tests[@]}"
  13. do
  14. echo "****************************"
  15. echo "* $t"
  16. echo "****************************"
  17. php -dextension=../ext/google/protobuf/modules/protobuf.so `which phpunit` $t
  18. echo ""
  19. done
  20. # Make sure to run the memory test in debug mode.
  21. php -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php
  22. USE_ZEND_ALLOC=0 valgrind --leak-check=yes php -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php