Annotation of parser3/tests/httpd/run_tests.sh, revision 1.4

1.1       moko        1: #!/bin/sh
1.4     ! moko        2: # httpd mode: the server runs the site with httpd class from etc/auto.p, see site/config.p
1.1       moko        3: 
1.4     ! moko        4: DIR=`pwd`
        !             5: PARSER=`pwd`/../../src/targets/cgi/parser3
        !             6: PORT=8100
1.1       moko        7: 
1.4     ! moko        8: (cd site && exec $PARSER -f config.p -p $PORT) &
        !             9: server=$!
        !            10: trap 'kill $server; exit 1' INT TERM
        !            11: # wait for the server listens
        !            12: for i in 1 2 3 4 5; do nc -z localhost $PORT 2>/dev/null && break; sleep 0.2; done
        !            13: 
        !            14: # the dates and the version of the server differ from run to run
        !            15: {
        !            16: for f in `ls ???.txt ???.curl | sort`; do
        !            17:        echo "running test $f"
        !            18:        case $f in
        !            19:                *.txt) nc localhost $PORT < $f ;;
        !            20:                *.curl) curl -s --config $f http://localhost:$PORT/form.html ;;
        !            21:        esac
        !            22:        echo
        !            23:        echo "============="
1.1       moko       24: done
1.4     ! moko       25: } 2>&1 | sed -E \
        !            26:        -e 's/^(Date|Last-Modified): .* GMT/\1: DATE GMT/' \
        !            27:        -e 's/^Server: Parser3\.[[:print:]]*/Server: Parser3.X.X .../' \
        !            28:        > tests.log
        !            29: 
        !            30: kill $server; wait $server 2>/dev/null
1.1       moko       31: 
1.4     ! moko       32: rm -f site/parser3.log
1.1       moko       33: diff -u ok.log tests.log

E-mail: