source: trunk/run @ 977

Last change on this file since 977 was 977, checked in by moo, 22 months ago

util script for running/make for developers

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