aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Michael Lumish <mlumish@google.com>2015-01-16 15:09:07 -0800
committerGravatar Michael Lumish <mlumish@google.com>2015-01-16 15:09:07 -0800
commited3e0b1af93a5e1a47729eefaf3190dc7f087808 (patch)
treec6a013a6928b7120ee57b111183be2388b578ee7 /src
parentaa6f99384191b81a1a11b8bf005e1098b864a9d5 (diff)
parentbc29d801594989b6cb6093ecff9ad78f31223e63 (diff)
Merge pull request #92 from ctiller/php
Allow running PHP unit tests from run_tests.py
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/php/.gitignore5
-rwxr-xr-xsrc/php/bin/run_tests.sh16
-rwxr-xr-xsrc/php/ext/grpc/config.m417
3 files changed, 23 insertions, 15 deletions
diff --git a/src/php/.gitignore b/src/php/.gitignore
index 00fbd965dc..0bb5f8e956 100755..100644
--- a/src/php/.gitignore
+++ b/src/php/.gitignore
@@ -15,4 +15,7 @@ run-tests.php
install-sh
libtool
missing
-mkinstalldirs \ No newline at end of file
+mkinstalldirs
+
+ext/grpc/ltmain.sh
+
diff --git a/src/php/bin/run_tests.sh b/src/php/bin/run_tests.sh
index cf4cc78a52..28282c3e37 100755
--- a/src/php/bin/run_tests.sh
+++ b/src/php/bin/run_tests.sh
@@ -1,5 +1,17 @@
+#!/bin/sh
# Loads the local shared library, and runs all of the test cases in tests/
# against it
+set -e
cd $(dirname $0)
-php -d extension_dir=../ext/grpc/modules/ -d extension=grpc.so \
- /usr/local/bin/phpunit -v --debug --strict ../tests/unit_tests
+default_extension_dir=`php -i | grep extension_dir | sed 's/.*=> //g'`
+
+# sym-link in system supplied extensions
+for f in $default_extension_dir/*.so
+do
+ ln -s $f ../ext/grpc/modules/$(basename $f) &> /dev/null || true
+done
+
+php \
+ -d extension_dir=../ext/grpc/modules/ \
+ -d extension=grpc.so \
+ `which phpunit` -v --debug --strict ../tests/unit_tests
diff --git a/src/php/ext/grpc/config.m4 b/src/php/ext/grpc/config.m4
index d7d13f413e..27c67781e7 100755
--- a/src/php/ext/grpc/config.m4
+++ b/src/php/ext/grpc/config.m4
@@ -38,7 +38,9 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD)
PHP_ADD_LIBRARY(rt)
- PHP_ADD_LIBPATH($GRPC_DIR/lib)
+ GRPC_LIBDIR=$GRPC_DIR/${GRPC_LIB_SUBDIR-lib}
+
+ PHP_ADD_LIBPATH($GRPC_LIBDIR)
PHP_CHECK_LIBRARY(gpr,gpr_now,
[
@@ -48,18 +50,9 @@ if test "$PHP_GRPC" != "no"; then
],[
AC_MSG_ERROR([wrong gpr lib version or lib not found])
],[
- -L$GRPC_DIR/lib
+ -L$GRPC_LIBDIR
])
- PHP_ADD_LIBRARY(event,,GRPC_SHARED_LIBADD)
- PHP_ADD_LIBRARY(event)
-
- PHP_ADD_LIBRARY(event_pthreads,,GRPC_SHARED_LIBADD)
- PHP_ADD_LIBRARY(event_pthreads)
-
- PHP_ADD_LIBRARY(event_core,,GRPC_SHARED_LIBADD)
- PHP_ADD_LIBRARY(event_core)
-
PHP_CHECK_LIBRARY(grpc,grpc_channel_destroy,
[
PHP_ADD_LIBRARY(grpc,,GRPC_SHARED_LIBADD)
@@ -68,7 +61,7 @@ if test "$PHP_GRPC" != "no"; then
],[
AC_MSG_ERROR([wrong grpc lib version or lib not found])
],[
- -L$GRPC_DIR/lib
+ -L$GRPC_LIBDIR
])
PHP_SUBST(GRPC_SHARED_LIBADD)