Skip to content

Commit

Permalink
Merge pull request #515 from dearblue/valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
matsumotory authored Nov 6, 2023
2 parents 69cc1d1 + 380d95e commit b3ca912
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ end
sh test.sh
```

If you want to run with valgrind, set the environment variables `NGINX_RUNNER` and `NGINX_HEATTIME`.

```console
$ NGINX_RUNNER=valgrind NGINX_HEATTIME=10 sh test.sh
```
10 changes: 7 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,23 @@ do
fi
done

: ${NGINX_RUNNER:=exec}
: ${NGINX_HEATTIME:=2}

echo "====================================="
echo ""
echo "ngx_mruby starting and logging"
echo ""
echo "====================================="
echo ""
echo ""
${NGINX_INSTALL_DIR}/sbin/nginx &
${NGINX_RUNNER} ${NGINX_INSTALL_DIR}/sbin/nginx &
nginx_pid=$!
trap "kill $nginx_pid; wait" EXIT
echo ""
echo ""
sleep 2 # waiting for nginx
sleep ${NGINX_HEATTIME} # waiting for nginx
./mruby/build/test/bin/mruby ./test/t/ngx_mruby.rb 2> ${NGINX_INSTALL_DIR}/logs/stderr.log
$KILLALL nginx
echo "ngx_mruby testing ... Done"

echo "test.sh ... successful"

0 comments on commit b3ca912

Please sign in to comment.