--- parser3/tests/httpd/code-cache/run_tests.sh 2026/10/05 23:31:56 1.1 +++ parser3/tests/httpd/code-cache/run_tests.sh 2026/10/30 01:25:50 1.3 @@ -9,8 +9,8 @@ class_file() { # file, class, method, te } 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' - echo + body=`printf 'GET /?%s HTTP/1.0\r\n\r\n' "$1" | nc localhost $PORT | tr -d '\r' | sed '1,/^$/d'` + printf '%s\n' "$body" } run() { # httpd mode, code cache: on or off @@ -18,8 +18,11 @@ run() { # httpd mode, code cache: on or class_file site/changing.p Changing version before 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=$! + cd .. # 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