diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-31 22:38:56 +0200 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-31 22:38:56 +0200 |
commit | 17f969380a7c4db6833faa97f44ab318484a062b (patch) | |
tree | 82f6cd274df9c65a5f72309a1140348ed00007ea | |
parent | 2e59a2955c79420cfd6de6c998cb94a1634fd5a4 (diff) | |
parent | de42543170dd911d878387db5efd2c9c4b399047 (diff) |
Merge pull request #61 from valmat/tests
Tests
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | tests/cpp/Makefile | 2 | ||||
-rw-r--r-- | tests/include/.gitignore | 2 | ||||
-rw-r--r-- | tests/include/zts/.gitignore (renamed from tests/cpp/zts/.gitignore) | 0 | ||||
-rwxr-xr-x | tests/test.sh | 24 |
5 files changed, 26 insertions, 6 deletions
@@ -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 |