language: c
compiler:
  - clang
  - gcc
env:
  - NGINX=1.9.11
  - NGINX=1.8.1
before_install:
  - sudo apt-get install -qq libpcre3-dev libssl-dev
  - sudo apt-get install -qq perl
  - env PERL_MM_USE_DEFAULT=1 cpan -fi Test::Nginx::Socket
cache: ccache
script: |
  wget -O - http://nginx.org/download/nginx-${NGINX}.tar.gz | tar -xzf -
  cd nginx-${NGINX}
  git clone https://github.com/openresty/headers-more-nginx-module.git -b v0.29
  ./configure --with-debug --add-module=.. --add-module=./headers-more-nginx-module
  make
  cd ..

  export PATH=$(pwd)/nginx-${NGINX}/objs/:$PATH
  eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)
  prove
