summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvalmat <ufabiz@gmail.com>2014-03-19 17:26:11 +0600
committervalmat <ufabiz@gmail.com>2014-03-19 17:26:11 +0600
commitcfc04aa191dd23b3e61ba4d714a194a3a4dd08f3 (patch)
tree1be33441fbb85b009f647b306bcabc5382c5a882 /tests
parent778561e1739a4a7ef20e85b713b4790e6be225d3 (diff)
Fixed issues #46
Diffstat (limited to 'tests')
-rwxr-xr-xtests/1.sh5
-rw-r--r--tests/cpp/Makefile6
-rw-r--r--tests/cpp/main.cpp2
-rwxr-xr-xtests/php/php_alias.sh3
-rw-r--r--tests/php/phpt/base/001.phpt2
-rw-r--r--tests/php/phpt/base/002.phpt2
-rw-r--r--tests/php/phpt/valueiterator/001.phpt5
-rw-r--r--tests/php/phpt/valueiterator/002.phpt2
-rw-r--r--tests/php/phpt/valueiterator/003.phpt2
-rw-r--r--tests/php/phpt/valueiterator/004.phpt2
-rw-r--r--tests/php/phpt/valueiterator/005.phpt2
-rw-r--r--tests/php/phpt/valueiterator/006.phpt2
-rw-r--r--tests/run-tests.php21
-rwxr-xr-xtests/test.sh8
14 files changed, 49 insertions, 15 deletions
diff --git a/tests/1.sh b/tests/1.sh
new file mode 100755
index 0000000..3705397
--- /dev/null
+++ b/tests/1.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+php -d enable_dl=On -d extension_dir=./ext_dir -d extension=extfortest.so -r "var_export(extension_loaded('extention_for_tests'));"
+
+php -i | grep LD
+
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