source: trunk/run-xcachetest @ 1401

Last change on this file since 1401 was 1401, checked in by moo, 14 months ago

hack report_memleaks=1 for devel testing

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/sh
2
3getAbsolutePath() {
4    which readlink >/dev/null 2>&1 && readlink -f "$@" || echo "$@"
5}
6
7# use symlink first
8if test -x ./php-cli ; then
9    php_cli=`getAbsolutePath ./php-cli`
10elif test ! -z "$TEST_PHP_EXECUTABLE" && test -x "$TEST_PHP_EXECUTABLE"; then
11    php_cli="$TEST_PHP_EXECUTABLE"
12else
13    php_cli="`which php`"
14fi
15
16if test -x ./php-cgi ; then
17    php_cgi=`getAbsolutePath ./php-cgi`
18else
19    php_cgi="`which php-cgi`"
20fi
21
22TEST_PHP_EXECUTABLE="$php_cli"
23TEST_PHP_CGI_EXECUTABLE="$php_cgi"
24real_php_src=`getAbsolutePath ./php-src`;
25test -z "$TEST_PHP_SRCDIR" && TEST_PHP_SRCDIR=$real_php_src
26
27export TEST_PHP_EXECUTABLE
28export TEST_PHP_CGI_EXECUTABLE
29export TEST_PHP_SRCDIR
30
31echo "XCache test running with:"
32echo "TEST_PHP_CGI_EXECUTABLE: $TEST_PHP_CGI_EXECUTABLE"
33echo "TEST_PHP_EXECUTABLE:     $TEST_PHP_EXECUTABLE"
34echo "TEST_PHP_SRCDIR:         $TEST_PHP_SRCDIR"
35
36patch_run_tests_ext() {
37    if test -z "$TEST_EXT" ; then
38        sed "s#'ext',##g"
39    else
40        cat
41    fi
42}
43patch_run_tests_report_leaks() {
44    if test -z "$TEST_REPORT_MEMLEAKS" ; then
45        sed "s#'report_memleaks=1',#'report_memleaks=0',#g"
46    else
47        cat
48    fi
49}
50run_tests_src=$real_php_src/run-tests.php
51patch_run_tests_ext < "$run_tests_src" | patch_run_tests_report_leaks > run-tests.php
52exec "$php_cli" -d "open_basedir=" -d "safe_mode=0" -d "output_buffering=0" -d "memory_limit=-1" `getAbsolutePath ./run-tests.php` "$@"
Note: See TracBrowser for help on using the repository browser.