|
|
| version 1.1, 2026/10/05 23:31:56 | version 1.3, 2026/10/30 01:25:50 |
|---|---|
| Line 9 class_file() { # file, class, method, te | Line 9 class_file() { # file, class, method, te |
| } | } |
| get() { # the response body of the test @name in site/tests.p | get() { # the response body of the test @name in site/tests.p |
| printf 'GET /?%s HTTP/1.0\r\n\r\n' "$1" | nc localhost $PORT | tr -d '\r' | sed '1,/^$/d' | body=`printf 'GET /?%s HTTP/1.0\r\n\r\n' "$1" | nc localhost $PORT | tr -d '\r' | sed '1,/^$/d'` |
| echo | printf '%s\n' "$body" |
| } | } |
| run() { # httpd mode, code cache: on or off | run() { # httpd mode, code cache: on or off |
| Line 18 run() { # httpd mode, code cache: on or | Line 18 run() { # httpd mode, code cache: on or |
| class_file site/changing.p Changing version before | class_file site/changing.p Changing version before |
| no_cache=; [ $2 = off ] && no_cache=1 | no_cache=; [ $2 = off ] && no_cache=1 |
| (cd site && TEST_HTTPD_MODE=$1 TEST_NO_CODE_CACHE=$no_cache CGI_PARSER_CONFIG=`pwd`/config.p exec $PARSER -p $PORT) & | # not in a subshell: on FreeBSD $! is the subshell then, the killed one is not the server |
| cd site | |
| TEST_HTTPD_MODE=$1 TEST_NO_CODE_CACHE=$no_cache CGI_PARSER_CONFIG=`pwd`/config.p $PARSER -p $PORT & | |
| server=$! | server=$! |
| cd .. | |
| # wait for the server listens | # wait for the server listens |
| for i in 1 2 3 4 5; do nc -z localhost $PORT 2>/dev/null && break; sleep 0.2; done | for i in 1 2 3 4 5; do nc -z localhost $PORT 2>/dev/null && break; sleep 0.2; done |