protobuf/php/tests/multirequest.sh
Joshua Haberman 2cc68efd56
Simplified PHP testing scripts. (#7574)
* Simplified PHP testing scripts.

- allow them to be run from any directory.
- remove "VERSION" arg, we can get PHP from $PATH.

* Added a few places I missed.

* Removed redundant "cd `dirname $0`".

Also replaced all backticks with $(), for consistency.
2020-05-28 19:24:08 -07:00

33 lines
575 B
Bash
Executable File

#!/bin/bash
cd $(dirname $0)
set -e
PORT=12345
./compile_extension.sh
nohup php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so -S localhost:$PORT multirequest.php 2>&1 &
sleep 1
wget http://localhost:$PORT/multirequest.result -O multirequest.result
wget http://localhost:$PORT/multirequest.result -O multirequest.result
pushd ../ext/google/protobuf
phpize --clean
popd
PID=`ps | grep "php" | awk '{print $1}'`
echo $PID
if [[ -z "$PID" ]]
then
echo "Failed"
exit 1
else
kill $PID
echo "Succeeded"
fi