os:
  - linux
  - osx
sudo: false
language: cpp
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - g++-4.8
env:
  matrix:
  - TRAVIS_NODE_VERSION="0.8"
  - TRAVIS_NODE_VERSION="0.10"
  - TRAVIS_NODE_VERSION="0.12"
  - TRAVIS_NODE_VERSION="iojs-1"
  - TRAVIS_NODE_VERSION="iojs-2"
  - TRAVIS_NODE_VERSION="iojs-3"
notifications:
  email:
    - rod@vagg.org
install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
  - npm install npm
  - mv node_modules npm
  - npm/.bin/npm --version
  - if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
  - $CXX --version
  - npm/.bin/npm install
  - if [[ $TRAVIS_NODE_VERSION == "0.8" ]]; then node_modules/.bin/node-gyp rebuild --directory test; else node_modules/.bin/pangyp rebuild --directory test; fi
script: if [[ $TRAVIS_OS_NAME == "linux" ]]; then tap --gc test/js/*-test.js; else node_modules/.bin/tap --gc teset/js/*-test.js; fi

os:
  - linux
  - osx
sudo: false
language: cpp
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - g++-4.8
env:
  matrix:
  - TRAVIS_NODE_VERSION="0.8"
  - TRAVIS_NODE_VERSION="0.10"
  - TRAVIS_NODE_VERSION="0.12"
  - TRAVIS_NODE_VERSION="iojs-1"
  - TRAVIS_NODE_VERSION="iojs-2"
  - TRAVIS_NODE_VERSION="iojs-3"
notifications:
  email:
    - rod@vagg.org
install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
  - npm install npm
  - mv node_modules npm
  - npm/.bin/npm --version
  - if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
  - $CXX --version
  - npm/.bin/npm install
  - if [[ $TRAVIS_NODE_VERSION == "0.8" ]]; then node_modules/.bin/node-gyp rebuild --directory test; else node_modules/.bin/pangyp rebuild --directory test; fi
script: node_modules/.bin/tap --gc test/js/*-test.js

Test using version of tap installed by npm install
Test using version of tap installed by npm install

Use `node_modules/.bin/tap` instead of just `tap`
so that testing works even without a globally set up
Node.js environment.
