Skip to content

Commit

Permalink
Merge pull request #2 from walf443/easy_testing
Browse files Browse the repository at this point in the history
make easy testing
  • Loading branch information
cubicdaiya committed May 25, 2015
2 parents f3b4cb0 + a2deec2 commit 1697794
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
t/servroot
nginx-build.ini
tmp/
cpanm
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
NGINX_VERSION=1.9.0

check: tmp/$(NGINX_VERSION)/nginx-$(NGINX_VERSION)/objs/nginx install-perl-lib
PERL5LIB=tmp/perl/lib/perl5/ TEST_NGINX_BINARY=tmp/$(NGINX_VERSION)/nginx-$(NGINX_VERSION)/objs/nginx \
tmp/perl/bin/prove -v --shuffle --timer t/*.t

build: tmp/$(NGINX_VERSION)/nginx-$(NGINX_VERSION)/objs/nginx

tmp/$(NGINX_VERSION)/nginx-$(NGINX_VERSION)/objs/nginx : *.c nginx-build nginx-build.ini
nginx-build -verbose -v=$(NGINX_VERSION) -d tmp/ -m nginx-build.ini

clean:
if [ -d tmp/$(NGINX_VERSION)/nginx-$(NGINX_VERSION) ]; then rm -rf tmp/$(NGINX_VERSION)/nginx-$(NGINX_VERSION); fi

nginx-build:
if ! nginx-build -version > /dev/null; then go get -u github.com/cubicdaiya/nginx-build; fi; true

nginx-build.ini:
echo "[ngx_dynamic_upstream]\nform=local\nurl=`pwd`" > nginx-build.ini

cpanm:
curl -L https://cpanmin.us/ -o cpanm
chmod +x cpanm

install-perl-lib: cpanm
./cpanm -l tmp/perl Test::Harness
./cpanm -l tmp/perl Test::Nginx

.PHONY: build check clean nginx-build install-perl-lib

0 comments on commit 1697794

Please sign in to comment.