source: trunk/run @ 980

Last change on this file since 980 was 980, checked in by moo, 21 months ago

fix make args

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2# this script is for developers only
3
4. run.cfg
5
6basename=$(basename $(pwd))
7if echo $basename | grep -- - >/dev/null; then :; else
8    dirs=${dirs:-php5-debug}
9    for dir in $dirs; do
10        cd ../${basename}-${dir} || exit
11        pwd
12        $0 "$@"
13    done
14    exit
15fi
16
17if [[ ! -z $1 ]]; then
18    type=$1
19    shift
20
21    if [[ ! -z $1 ]]; then
22        args=("$@")
23    elif [[ -z $args ]]; then
24        args=(test.php)
25    fi
26fi
27
28if [[ $type = make ]]; then
29    MAKEARGS=("$@")
30fi
31
32LANG=C /usr/bin/make $MAKEOPTS "${MAKEARGS[@]}" 2>&1 | hi error warn FAIL
33ret=${PIPESTATUS[0]}
34if [[ $ret -ne 0 || $type = make ]]; then
35    exit $ret
36fi
37
38cmd=()
39tracer=()
40case "$basename" in
41*-apache1*)
42    cmd=($HOME/apache1/bin/httpd -X)
43    ;;
44*-apache*)
45    exit 1
46    ;;
47*)
48    cmd=(./php-cgi -q -c php.ini)
49    "${cmd[@]}" -v
50    ;;
51esac
52
53case "${args[0]}" in
54fcgi)
55    args=(-b 1026)
56    shift
57    ;;
58esac
59
60case "$type" in
61ltr*)
62    export USE_ZEND_ALLOC=0
63    tracer=(ltrace -s1024 -e malloc,realloc,free,write)
64    ;;
65str*)
66    tracer=(strace -s1024 -T ./php-cgi)
67    ;;
68gdb)
69    #USE_ZEND_ALLOC=0
70    tracer=(gdb --args)
71    ;;
72val*)
73    export USE_ZEND_ALLOC=0
74    tracer=(valgrind --gen-suppressions=all)
75    ;;
76dc)
77    exec ./php-cli -c php.ini ./phpdc.phpr "${args[@]}" | tee decompiled.php
78    ;;
79dop)
80    exec ./php-cgi -q -c php.ini ./phpdop.phpr "${args[@]}"
81    ;;
82retest)
83    exec make xcachetest "$@" TESTS="`grep '^/.*\.phpt$' php_test_results_*.txt | uniq | xargs`"
84    ;;
85test)
86    case "${args[0]}" in
87    *.phpt)
88        exec make xcachetest TEST_ARGS=-v TESTS="${args[*]}"
89        ;;
90    */)
91        exec make xcachetest TESTS="${args[@]}"
92        ;;
93    *)
94        exec make xcachetest
95        ;;
96    esac
97    ;;
98esac
99
100export XCACHE_SKIP_FCGI_WARNING=1
101echo "${tracer[@]}" "${cmd[@]}" "${args[@]}"
102exec "${tracer[@]}" "${cmd[@]}" "${args[@]}"
Note: See TracBrowser for help on using the repository browser.