X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Frun_pazpar2.sh;h=c0b8f851d89097f591754a4e8f0b8634bbc1fb83;hb=d96989af3aa0eb866948a3f6564e5b384a980fdf;hp=34829b924352ba948eb243d6df82f284a761f4ba;hpb=cb191200e0b637d4448af419380cff16b3b800bd;p=pazpar2-moved-to-github.git diff --git a/test/run_pazpar2.sh b/test/run_pazpar2.sh index 34829b9..c0b8f85 100755 --- a/test/run_pazpar2.sh +++ b/test/run_pazpar2.sh @@ -17,6 +17,7 @@ kill_pazpar2() if test -z "$SKIP_PAZPAR2" -a -n "$PP2PID"; then kill $PP2PID PP2PID="" + rm -f pazpar2.pid fi if test -f ztest.pid; then kill `cat ztest.pid` @@ -28,7 +29,6 @@ kill_pazpar2() fi } -perf=false ztest=false icu=false while test $# -gt 0; do @@ -43,9 +43,6 @@ while test $# -gt 0; do --icu) icu=true ;; - --perf) - perf=true - ;; -*) echo "Bad option $1" exit 1 @@ -62,6 +59,17 @@ if test "x${PREFIX}" = "x"; then exit 1 fi +URLS=${PREFIX}.urls +if test ! -f ${srcdir}/${URLS}; then + echo "${srcdir}/${URLS} missing" + exit 1 +fi +CFG=${PREFIX}.cfg +if test ! -f ${srcdir}/${CFG}; then + echo "${srcdir}/${CFG} missing" + exit 1 +fi + # look for curl in PATH oIFS=$IFS IFS=: @@ -139,8 +147,6 @@ if [ -z "$SKIP_PAZPAR2" ] ; then rm -f ${PREFIX}_pazpar2.log fi -CFG=${PREFIX}.cfg -URLS=${PREFIX}.urls VALGRINDLOG=${PREFIX}_valgrind.log if test `uname` = "Linux"; then @@ -151,20 +157,21 @@ else maxrounds=10 fi LEVELS=loglevel,fatal,warn,log,debug,zoom,zoomdetails -if test -n "$PAZPAR2_USE_VALGRIND"; then +if test "$PERF_PROG"; then + eval $PERF_PROG ../src/pazpar2 -p pazpar2.pid -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 & + PP2PID=$! + sleep 5 + if test -f pazpar2.pid; then + PP2PID=`cat pazpar2.pid` + echo "Got PID $PP2PID" + fi +elif test -n "$PAZPAR2_USE_VALGRIND"; then valgrind --num-callers=30 --show-reachable=yes --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -v $LEVELS -X -l ${PREFIX}_pazpar2.log -f ${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 & PP2PID=$! sleep 0.01 WAIT=400 elif test -n "$SKIP_PAZPAR2"; then echo "${PREFIX}: not starting Pazpar2 (should be running already)" -elif $perf; then - /usr/bin/time -p ../src/pazpar2 -p pazpar2.pid -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 & - PP2PID=$! - sleep 1 - if test -f pazpar2.pid; then - PP2PID=`cat pazpar2.pid` - fi else ../src/pazpar2 -v $LEVELS -d -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 & PP2PID=$! @@ -283,7 +290,7 @@ if [ "$WAIT_PAZPAR2" ] ; then fi kill_pazpar2 sleep 2 -if $perf; then +if test "$PERF_PROG"; then tail -3 ${PREFIX}_extra_pazpar2.log fi exit $code