summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-01 15:05:10 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-01 15:05:10 +0200
commit777949f8751ded6e56140bb513c6b93e4d5c3f08 (patch)
treea46faeb1f160f09a1c4db82108a29245793b230f
parent4f32de6cc535bc19810801d51892c05b9e49f47b (diff)
parent17f969380a7c4db6833faa97f44ab318484a062b (diff)
Merge branch 'master' of https://github.com/CopernicaMarketingSoftware/PHP-CPP
-rw-r--r--Makefile4
-rw-r--r--tests/cpp/Makefile2
-rw-r--r--tests/include/.gitignore2
-rw-r--r--tests/include/zts/.gitignore (renamed from tests/cpp/zts/.gitignore)0
-rwxr-xr-xtests/test.sh24
5 files changed, 26 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 497beb8..ce4c59e 100644
--- a/Makefile
+++ b/Makefile
@@ -171,7 +171,7 @@ install:
${CONFIG_UTILITY} > ${INSTALL_HEADERS}/phpcpp/config.h
test:
- mkdir -p ./tests/cpp/zts/phpcpp
- ${CONFIG_UTILITY} > ./tests/cpp/zts/phpcpp/config.h
+ mkdir -p ./tests/include/zts/phpcpp
+ ${CONFIG_UTILITY} > ./tests/include/zts/phpcpp/config.h
cd tests && ./test.sh -p "${PHP_BIN}"
diff --git a/tests/cpp/Makefile b/tests/cpp/Makefile
index 6239170..90b3946 100644
--- a/tests/cpp/Makefile
+++ b/tests/cpp/Makefile
@@ -88,7 +88,7 @@ LINKER = g++
#
LIB_DIR=$(shell cd ../.. && pwd)
-COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -I"${LIB_DIR}/include" -I"./zts" -o
+COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -I"${LIB_DIR}/tests/include/lib" -I"${LIB_DIR}/tests/include/zts" -o
LINKER_FLAGS = -shared -L"${LIB_DIR}"
LINKER_DEPENDENCIES = -lphpcpp
diff --git a/tests/include/.gitignore b/tests/include/.gitignore
new file mode 100644
index 0000000..492755a
--- /dev/null
+++ b/tests/include/.gitignore
@@ -0,0 +1,2 @@
+*.h
+/lib/*
diff --git a/tests/cpp/zts/.gitignore b/tests/include/zts/.gitignore
index 8d82a92..8d82a92 100644
--- a/tests/cpp/zts/.gitignore
+++ b/tests/include/zts/.gitignore
diff --git a/tests/test.sh b/tests/test.sh
index 8f5baa5..df0e949 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -102,7 +102,7 @@ do
exit;
;;
t)
- TEST_FILES="$OPTARG"
+ TEST_FILES="${TEST_FILES}${OPTARG} "
;;
x)
SCR_OPT="$SCR_OPT -x"
@@ -145,16 +145,34 @@ SCR_OPT="$SCR_OPT -d extension_dir=$PWD/ext_dir -d extension=$EXT_NAME"
# Create a local copy of the directory with the extension for run without installation
./prepare.sh $EXT_NAME
+# Absolute path to library
+LIBRARY_PATH="$(cd $PWD/.. && echo $PWD)"
if [ 1 = $COMPILE_EXT ]; then
+
+ # Create a local copy of header files
+ PHPCPP_H="$LIBRARY_PATH/tests/include/lib/phpcpp.h"
+ PHPCPP_INC="$LIBRARY_PATH/tests/include/lib/phpcpp"
+ mkdir -p "$LIBRARY_PATH/tests/include/lib"
+ # local copy of /usr/include/phpcpp.h:
+ if [ ! -L $PHPCPP_H ];
+ then
+ ln -s "$LIBRARY_PATH/phpcpp.h" $PHPCPP_H
+ fi
+ # local copy of /usr/include/phpcpp:
+ if [ -a $PHPCPP_INC ];
+ then
+ rm -rf $PHPCPP_INC
+ fi
+ ln -s "$LIBRARY_PATH/include" $PHPCPP_INC
+
echo "Compile the test extension"
cd cpp
make clean && make
cd ..
fi
-
-LD_LIBRARY_PATH="$(cd $PWD/.. && echo $PWD):${LD_LIBRARY_PATH}"
+LD_LIBRARY_PATH="${LIBRARY_PATH}:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH