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-3"
  - TRAVIS_NODE_VERSION="4"
notifications:
  email:
    - rod@vagg.org
install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && 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
  - node_modules/.bin/node-gyp rebuild --directory test
script: node_modules/.bin/tap --gc test/js/*-test.js

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-3"
  - TRAVIS_NODE_VERSION="4"
notifications:
  email:
    - rod@vagg.org
install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
  - if [[ $TRAVIS_NODE_VERSION == "0.8" ]]; then npm install npm@2 && node_modules/.bin/npm install npm; else npm install npm; fi
  - 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
  - node_modules/.bin/node-gyp rebuild --directory test
script: node_modules/.bin/tap --gc test/js/*-test.js

Install npm 2 before npm 3 for Node 0.8 on Travis
Install npm 2 before npm 3 for Node 0.8 on Travis