test.sh 862 B

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