diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-19 12:33:53 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-19 12:33:53 +0100 |
commit | 8dbf5a11840ed4f4029de3780a063f7ef7736172 (patch) | |
tree | 3a8b75c539068415984e6324bb46ea1f7c9c7dfa | |
parent | f2d205fa498388022f8915db211284326d0f2a4e (diff) | |
parent | af8c43374bda341b07d941ed395a600913e9d6ba (diff) |
Merge pull request #48 from valmat/fix-issues-46
Fix issue # 46
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | tests/cpp/Makefile | 6 | ||||
-rw-r--r-- | tests/cpp/main.cpp | 2 | ||||
-rwxr-xr-x | tests/php/php_alias.sh | 3 | ||||
-rw-r--r-- | tests/php/phpt/base/001.phpt | 2 | ||||
-rw-r--r-- | tests/php/phpt/base/002.phpt | 2 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/001.phpt | 5 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/002.phpt | 2 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/003.phpt | 2 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/004.phpt | 2 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/005.phpt | 2 | ||||
-rw-r--r-- | tests/php/phpt/valueiterator/006.phpt | 2 | ||||
-rw-r--r-- | tests/run-tests.php | 21 | ||||
-rwxr-xr-x | tests/test.sh | 8 |
14 files changed, 49 insertions, 19 deletions
@@ -137,10 +137,11 @@ OBJECTS = $(SOURCES:%.cpp=%.o) # all: ${OBJECTS} ${RESULT} - @echo - @echo "Build complete." - @echo "Don't forget to run 'make test'." - @echo +# Before offering to run the tests, we need to write more tests +# @echo +# @echo "Build complete." +# @echo "Don't forget to run 'make test'." +# @echo ${RESULT}: ${OBJECTS} ${LINKER} ${LINKER_FLAGS} -o $@ ${OBJECTS} diff --git a/tests/cpp/Makefile b/tests/cpp/Makefile index 2a3cbaf..0b6800c 100644 --- a/tests/cpp/Makefile +++ b/tests/cpp/Makefile @@ -87,11 +87,11 @@ LINKER = g++ # one: the PHP-CPP library), you should update the LINKER_DEPENDENCIES variable # with a list of all flags that should be passed to the linker. # - +LIB_DIR=$(shell cd ../.. && pwd) #COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -o #COMPILER_FLAGS = -Wall -c -g -std=c++11 -fpic -o -COMPILER_FLAGS = -Wall -c -g -std=c++11 -fpic -I. -I"../../include" -o -LINKER_FLAGS = -shared +COMPILER_FLAGS = -Wall -c -g -std=c++11 -fpic -I. -I"${LIB_DIR}/include" -o +LINKER_FLAGS = -shared -L"${LIB_DIR}" LINKER_DEPENDENCIES = -lphpcpp diff --git a/tests/cpp/main.cpp b/tests/cpp/main.cpp index 7a4c15d..154b61b 100644 --- a/tests/cpp/main.cpp +++ b/tests/cpp/main.cpp @@ -20,7 +20,7 @@ extern "C" PHPCPP_EXPORT void *get_module() { // create extension - static Php::Extension extension("extention_for_tests","0.1"); + static Php::Extension extension("extension_for_tests","0.1"); // build an interface //Php::Interface interface("MyInterface"); diff --git a/tests/php/php_alias.sh b/tests/php/php_alias.sh index 2c028ca..34c2918 100755 --- a/tests/php/php_alias.sh +++ b/tests/php/php_alias.sh @@ -13,4 +13,7 @@ then exit; fi +LD_LIBRARY_PATH="$(cd $PWD/../.. && echo $PWD):${LD_LIBRARY_PATH}" +export LD_LIBRARY_PATH + /usr/bin/php -d enable_dl=On -d extension_dir=../ext_dir -d extension=extfortest.so $1 diff --git a/tests/php/phpt/base/001.phpt b/tests/php/phpt/base/001.phpt index 91175d7..b22a44c 100644 --- a/tests/php/phpt/base/001.phpt +++ b/tests/php/phpt/base/001.phpt @@ -1,7 +1,7 @@ --TEST-- Test constructor & destructor --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php diff --git a/tests/php/phpt/base/002.phpt b/tests/php/phpt/base/002.phpt index a6f611b..847e602 100644 --- a/tests/php/phpt/base/002.phpt +++ b/tests/php/phpt/base/002.phpt @@ -1,7 +1,7 @@ --TEST-- Test constructor & destructor --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php diff --git a/tests/php/phpt/valueiterator/001.phpt b/tests/php/phpt/valueiterator/001.phpt index ae85e23..af75ce6 100644 --- a/tests/php/phpt/valueiterator/001.phpt +++ b/tests/php/phpt/valueiterator/001.phpt @@ -3,7 +3,7 @@ Iterate array --DESCRIPTION-- Iterate regular php array --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php require dirname(__FILE__) . '/../../include/valueiterator/1.php'; @@ -18,5 +18,4 @@ Array/Object contains 4 items [qwe]=qweqweqweqw [0]=5 [asd]=«£¥§©®°±¶⅐⅒⅓⅘⅞Ⅻↆ❄❅❆⚑⚐⌛⌚〰» -[zxccvx]=sdfsecvyh6bug6yfty - +[zxccvx]=sdfsecvyh6bug6yfty
\ No newline at end of file diff --git a/tests/php/phpt/valueiterator/002.phpt b/tests/php/phpt/valueiterator/002.phpt index 59d5dad..fdffdf7 100644 --- a/tests/php/phpt/valueiterator/002.phpt +++ b/tests/php/phpt/valueiterator/002.phpt @@ -3,7 +3,7 @@ Iterate object of stdClass --DESCRIPTION-- Iterate object of stdClass --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php require dirname(__FILE__) . '/../../include/valueiterator/1.php'; diff --git a/tests/php/phpt/valueiterator/003.phpt b/tests/php/phpt/valueiterator/003.phpt index 4155a2d..d29d7e5 100644 --- a/tests/php/phpt/valueiterator/003.phpt +++ b/tests/php/phpt/valueiterator/003.phpt @@ -3,7 +3,7 @@ Iterate object --DESCRIPTION-- Iterate regular php object --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php require dirname(__FILE__) . '/../../include/valueiterator/1.php'; diff --git a/tests/php/phpt/valueiterator/004.phpt b/tests/php/phpt/valueiterator/004.phpt index 3e6afb7..432b500 100644 --- a/tests/php/phpt/valueiterator/004.phpt +++ b/tests/php/phpt/valueiterator/004.phpt @@ -3,7 +3,7 @@ Iterate itarable oblect --DESCRIPTION-- class impIterator implements Iterator --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php require dirname(__FILE__) . '/../../include/valueiterator/1.php'; diff --git a/tests/php/phpt/valueiterator/005.phpt b/tests/php/phpt/valueiterator/005.phpt index e5df91e..f86845e 100644 --- a/tests/php/phpt/valueiterator/005.phpt +++ b/tests/php/phpt/valueiterator/005.phpt @@ -3,7 +3,7 @@ Iterate itarable oblect --DESCRIPTION-- class impIterAggr1 implements IteratorAggregate --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php require dirname(__FILE__) . '/../../include/valueiterator/1.php'; diff --git a/tests/php/phpt/valueiterator/006.phpt b/tests/php/phpt/valueiterator/006.phpt index d31cdda..82bc44b 100644 --- a/tests/php/phpt/valueiterator/006.phpt +++ b/tests/php/phpt/valueiterator/006.phpt @@ -3,7 +3,7 @@ Iterate itarable oblect --DESCRIPTION-- class impIterAggr1 implements IteratorAggregate --SKIPIF-- -<?php if (!extension_loaded("extention_for_tests")) print "skip"; ?> +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- <?php require dirname(__FILE__) . '/../../include/valueiterator/1.php'; diff --git a/tests/run-tests.php b/tests/run-tests.php index 2e55e05..c2616a3 100644 --- a/tests/run-tests.php +++ b/tests/run-tests.php @@ -1792,6 +1792,27 @@ SCRIPT_FILENAME = " . $env['SCRIPT_FILENAME'] . " HTTP_COOKIE = " . $env['HTTP_COOKIE'] . " COMMAND $cmd "; + // + /* + * Fixed for tests extension without installation + * extension_for_tests + */ + /* + $_LD_LIBRARY_PATH = isset($_SERVER["LD_LIBRARY_PATH"]) ? + ('LD_LIBRARY_PATH="' . $_SERVER["LD_LIBRARY_PATH"] . "\"\nexport LD_LIBRARY_PATH") + + : + "###"; + $_LD_LIBRARY_PATH_ex = isset($_SERVER["LD_LIBRARY_PATH"]) ? + ('LD_LIBRARY_PATH="' . $_SERVER["LD_LIBRARY_PATH"] . "\" && export LD_LIBRARY_PATH && ") + + : + ""; + */ + + //$cmd = "LD_LIBRARY_PATH=\"/home/valmat/work/PHP-CPP\" && export LD_LIBRARY_PATH && $cmd"; + //$cmd = "${_LD_LIBRARY_PATH_ex}$cmd"; + junit_start_timer($shortname); diff --git a/tests/test.sh b/tests/test.sh index f055b43..b7e2406 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -92,7 +92,7 @@ fi TEST_FILES=`find ./php/phpt -type f -name "*.phpt"` #RUN_SCR="$PHP_BIN -z ./cpp/$EXT_NAME" -RUN_SCR="$PHP_BIN -d enable_dl=On -d extension_dir=./ext_dir -d extension=$EXT_NAME" +RUN_SCR="$PHP_BIN -d enable_dl=On -d extension_dir=$PWD/ext_dir -d extension=$EXT_NAME" # Create a local copy of the directory with the extension for run without installation @@ -107,6 +107,12 @@ if [ 1 = $COMPILE_EXT ]; then fi + +LD_LIBRARY_PATH="$(cd $PWD/.. && echo $PWD):${LD_LIBRARY_PATH}" +export LD_LIBRARY_PATH +echo $LD_LIBRARY_PATH + +RUN_SCR="LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\" && export LD_LIBRARY_PATH && $RUN_SCR" # run tests $PHP_BIN run-tests.php $SCR_OPT -p "$RUN_SCR" $TEST_FILES |