Browse Source

fix tests for older php

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1573 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 6 years ago
parent
commit
cbbd582fef
3 changed files with 16 additions and 6 deletions
  1. +14
    -4
      run-xcachetest
  2. +1
    -1
      tests/skipif.inc
  3. +1
    -1
      tests/xcache_is_autoglobal.phpt

+ 14
- 4
run-xcachetest View File

@ -13,14 +13,24 @@ else
php_cli="`which php`"
fi
test_args="-c \"$TEST_INI\""' -d "open_basedir=" -d "safe_mode=0" -d "output_buffering=0" -d "memory_limit=-1"'
if test -x ./php-cgi ; then
php_cgi=`getAbsolutePath ./php-cgi`
else
php_cgi="`which php-cgi`"
fi
TEST_PHP_EXECUTABLE="$php_cli"
TEST_PHP_CGI_EXECUTABLE="$php_cgi"
echo '#!/bin/sh' > ./php-cli-test
echo 'exec "'$php_cli'" '$test_args' "$@"' >> php-cli-test
chmod +x ./php-cli-test
echo '#!/bin/sh' > ./php-cgi-test
echo 'exec "'$php_cgi'" '$test_args' "$@"' >> php-cgi-test
chmod +x ./php-cgi-test
TEST_PHP_EXECUTABLE=`getAbsolutePath ./php-cli-test`
TEST_PHP_CGI_EXECUTABLE=`getAbsolutePath ./php-cgi-test`
real_php_src=`getAbsolutePath ./php-src`;
test -z "$TEST_PHP_SRCDIR" && TEST_PHP_SRCDIR=$real_php_src
@ -48,5 +58,5 @@ patch_run_tests_report_leaks() {
fi
}
run_tests_src=$real_php_src/run-tests.php
patch_run_tests_ext < "$run_tests_src" | patch_run_tests_report_leaks > run-tests.php
exec "$php_cli" -d "open_basedir=" -d "safe_mode=0" -d "output_buffering=0" -d "memory_limit=-1" `getAbsolutePath ./run-tests.php` "$@"
patch_run_tests_ext < "$run_tests_src" | sed "s#^\\\$test_dirs = array('.*#\\\$test_dirs = array();#" | patch_run_tests_report_leaks > run-tests.php
exec "$TEST_PHP_EXECUTABLE" `getAbsolutePath ./run-tests.php` "$@"

+ 1
- 1
tests/skipif.inc View File

@ -1,5 +1,5 @@
<?php
if (!extension_loaded("xcache")) {
if (version_compare(phpversion(), '5.2', '>=') && !extension_loaded("xcache")) {
die("skip xcache extension not loaded");
}
?>

+ 1
- 1
tests/xcache_is_autoglobal.phpt View File

@ -9,7 +9,7 @@ xcache.test = 1
xcache.size = 32M
--FILE--
<?php
var_dump(xcache_is_autoglobal("GLOBALS"));
var_dump(xcache_is_autoglobal("_GET"));
?>
--EXPECT--
bool(true)

Loading…
Cancel
Save