aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/bin/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/php/bin/run_tests.sh')
-rwxr-xr-xsrc/php/bin/run_tests.sh35
1 files changed, 4 insertions, 31 deletions
diff --git a/src/php/bin/run_tests.sh b/src/php/bin/run_tests.sh
index 422757bb44..e3289e34d2 100755
--- a/src/php/bin/run_tests.sh
+++ b/src/php/bin/run_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright 2015, Google Inc.
# All rights reserved.
#
@@ -32,33 +32,6 @@
# against it
set -e
cd $(dirname $0)
-default_extension_dir=`php -i | grep extension_dir | sed 's/.*=> //g'`
-
-if command -v brew >/dev/null && [ -d `brew --prefix`/opt/grpc-php ]
-then
- # homebrew and the grpc-php formula are installed
- extension_dir="-d extension_dir="`brew --prefix`/opt/grpc-php
-elif [ ! -e $default_extension_dir/grpc.so ]
-then
- # the grpc extension is not found in the default PHP extension dir
- # try the source modules directory
- module_dir=../ext/grpc/modules
- if [ ! -d $module_dir ]
- then
- echo "Please run 'phpize && ./configure && make' from ext/grpc first"
- exit 1
- fi
-
- # sym-link in system supplied extensions
- for f in $default_extension_dir/*.so
- do
- ln -s $f $module_dir/$(basename $f) &> /dev/null || true
- done
-
- extension_dir='-d extension_dir='$module_dir
-fi
-
-php \
- $extension_dir \
- -d extension=grpc.so \
- `which phpunit` -v --debug --strict ../tests/unit_tests
+source ./determine_extension_dir.sh
+php $extension_dir -d extension=grpc.so `which phpunit` -v --debug --strict \
+ ../tests/unit_tests