Skip to content

Commit 5be27ee

Browse files
committed
Define trap earlier in test script
1 parent f9f4a38 commit 5be27ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ nginx/.FOLDER: src/objs/nginx
106106
test:
107107
@./nginx/nginx -c "$$PWD/test.conf" -e /dev/fd/1 -p nginx & \
108108
nginx_pid="$$!" && \
109+
trap 'kill "$$nginx_pid"; rm -rf nginx/*_temp/' EXIT && \
109110
(sleep 0.05 >/dev/null 2>&1 || :) && \
110111
if ! kill -1 "$$nginx_pid"; then \
111112
echo "make $@: unable to start nginx" >&2; \
@@ -115,7 +116,6 @@ test:
115116
nc -zw1 localhost 4475 && break; \
116117
sleep 1; \
117118
done; \
118-
trap 'kill "$$nginx_pid"; rm -rf nginx/*_temp/' EXIT && \
119119
curl -fsS http://localhost:4475/ >/dev/null || exit_status="$$?" && \
120120
exit "$${exit_status:-0}"
121121
@echo "make $@: test passed"

0 commit comments

Comments
 (0)