1
0
Fork 0

util script for running/make for developers

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@977 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2012-07-16 07:55:34 +00:00
parent 032a12aeea
commit fb9bb38e75
2 changed files with 103 additions and 0 deletions

2
make Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec ./run make "$@"

101
run Executable file
View File

@ -0,0 +1,101 @@
#!/bin/bash
# this script is for developers only
. run.cfg
basename=$(basename $(pwd))
if echo $basename | grep -- - >/dev/null; then :; else
dirs=${dirs:-php5-debug}
for dir in $dirs; do
cd ../${basename}-${dir} || exit
pwd
$0 "$@"
done
exit
fi
LANG=C /usr/bin/make $MAKEOPTS "$@" 2>&1 | hi error warn FAIL
ret=${PIPESTATUS[0]}
if [[ $ret -ne 0 ]]; then
exit $ret
fi
if [[ ! -z $1 ]]; then
type=$1
shift
if [[ ! -z $1 ]]; then
args=("$@")
elif [[ -z $args ]]; then
args=(test.php)
fi
fi
cmd=()
tracer=()
case "$basename" in
*-apache1*)
cmd=($HOME/apache1/bin/httpd -X)
;;
*-apache*)
exit 1
;;
*)
cmd=(./php-cgi -q -c php.ini)
"${cmd[@]}" -v
;;
esac
case "${args[0]}" in
fcgi)
args=(-b 1026)
shift
;;
esac
case "$type" in
make)
exit
;;
ltr*)
export USE_ZEND_ALLOC=0
tracer=(ltrace -s1024 -e malloc,realloc,free,write)
;;
str*)
tracer=(strace -s1024 -T ./php-cgi)
;;
gdb)
#USE_ZEND_ALLOC=0
tracer=(gdb --args)
;;
val*)
export USE_ZEND_ALLOC=0
tracer=(valgrind --gen-suppressions=all)
;;
dc)
exec ./php-cli -c php.ini ./phpdc.phpr "${args[@]}" | tee decompiled.php
;;
dop)
exec ./php-cgi -q -c php.ini ./phpdop.phpr "${args[@]}"
;;
retest)
exec make xcachetest "$@" TESTS="`grep '^/.*\.phpt$' php_test_results_*.txt | uniq | xargs`"
;;
test)
case "${args[0]}" in
*.phpt)
exec make xcachetest TEST_ARGS=-v TESTS="${args[*]}"
;;
*/)
exec make xcachetest TESTS="${args[@]}"
;;
*)
exec make xcachetest
;;
esac
;;
esac
export XCACHE_SKIP_FCGI_WARNING=1
echo "${tracer[@]}" "${cmd[@]}" "${args[@]}"
exec "${tracer[@]}" "${cmd[@]}" "${args[@]}"