File tree 3 files changed +40
-0
lines changed
3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -102,3 +102,21 @@ nginx/.FOLDER: src/objs/nginx
102
102
(cd src && $( MAKE) DESTDIR=$( PWD) /$( @D) / install)
103
103
(cd $( @D) && rm -f * .default koi-win koi-utf win-utf)
104
104
touch $@
105
+
106
+ test :
107
+ @./nginx/nginx -c " $$ PWD/test.conf" -e /dev/fd/1 -p nginx & \
108
+ nginx_pid=" $$ !" && \
109
+ (sleep 0.05 > /dev/null 2>&1 || :) && \
110
+ if ! kill -1 " $$ nginx_pid" ; then \
111
+ echo " make $@ : unable to start nginx" >&2 ; \
112
+ exit 1; \
113
+ fi ; \
114
+ for _ in 1 2 3; do \
115
+ nc -zw1 localhost 4475 && break ; \
116
+ sleep 1; \
117
+ done ; \
118
+ trap ' kill "$$nginx_pid"' EXIT && \
119
+ curl -fsS http://localhost:4475/ > /dev/null || exit_status=" $$ ?" && \
120
+ rm -rf nginx/* _temp/ && \
121
+ exit " $$ {exit_status:-0}"
122
+ @echo " make $@ : test passed"
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ Some of the other targets provided by the Makefile include:
34
34
- ** clean** : Delete all folders created by this script.
35
35
- ** cleaner** : Delete all files created by this script which includes the
36
36
downloaded tar-balls.
37
+ - ** test:** Run a simple test of NGINX. The NGINX binary must already be built,
38
+ port 4475 must be available for use, and _ curl(1)_ must be installed. This
39
+ target does not implicitly build NGINX.
37
40
38
41
Attributions
39
42
------------
Original file line number Diff line number Diff line change
1
+ worker_processes 1;
2
+ daemon off;
3
+
4
+ events {
5
+ worker_connections 1024;
6
+ }
7
+
8
+ http {
9
+ server {
10
+ listen 4475;
11
+ server_name localhost;
12
+ access_log /dev/null;
13
+
14
+ location / {
15
+ root html;
16
+ index index.html index.htm;
17
+ }
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments