language: node_js

node_js:
 - "0.10"
 - "0.8"
 - "0.6"

before_install:
 - sudo apt-get -qq update

install:
 - npm install
 - npm install mocha
 - npm test

before_script:
 - make clean

script:
 - npm install --stage
 - npm test
 - sudo apt-get -qq install libsqlite3-dev
 - make clean
 - npm install --build-from-source --sqlite=/usr
 - ldd lib/binding/*/*/*node
 - npm test
 - make clean
 - export NVER=`node -v`
 - export PATH=$(pwd)/node-${NVER}-linux-x86/bin:$PATH
 - if [[ "$NVER" != v0.6* ]]; then wget http://nodejs.org/dist/${NVER}/node-${NVER}-linux-x86.tar.gz; fi
 - if [[ "$NVER" != v0.6* ]]; then tar xf node-${NVER}-linux-x86.tar.gz; fi
 - if [[ "$NVER" != v0.6* ]]; then npm install --target_arch=ia32; fi
 - if [[ "$NVER" != v0.6* ]]; then ldd lib/binding/*/*/*node; fi
 - if [[ "$NVER" != v0.6* ]]; then npm test; fi
 - if [[ "$NVER" != v0.6* ]]; then make clean; fi
 - if [[ "$NVER" != v0.6* ]]; then sudo apt-get -y install libsqlite3-dev:i386 binutils:i386 cpp:i386 gcc-4.6:i386 g++-4.6:i386 libstdc++6-4.6-dev:i386 | true; fi
 - if [[ "$NVER" != v0.6* ]]; then CC=gcc-4.6 CXX=g++-4.6 npm install --target_arch=ia32 --sqlite=/usr; fi
 - if [[ "$NVER" != v0.6* ]]; then ldd lib/binding/*/*/*node; fi
 - if [[ "$NVER" != v0.6* ]]; then npm test; fi