summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvalmat <ufabiz@gmail.com>2014-04-01 01:04:52 +0600
committervalmat <ufabiz@gmail.com>2014-04-01 01:04:52 +0600
commitb135af43c136dc2ec79da61be9b234ce00c96775 (patch)
tree89711ef4473261aaf85acf8df071727b68c54b85 /tests
parent2e59a2955c79420cfd6de6c998cb94a1634fd5a4 (diff)
Fix: run tests without compile
Diffstat (limited to 'tests')
-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.sh23
4 files changed, 24 insertions, 3 deletions
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..9c264a9 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -145,16 +145,35 @@ 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 [ -L $PHPCPP_INC ] || [ -d $PHPCPP_INC ];
+ 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