language: c
compiler:
  - gcc
  - clang
env:
  - BINDINGS=none
matrix:
  include:
    - compiler: gcc
      language: ruby
      rvm: ruby-1.9.3-p484
      env: BINDINGS=ruby
    - compiler: clang
      language: ruby
      rvm: ruby-1.9.3-p484
      env: BINDINGS=ruby CC="clang --coverage"
    - compiler: gcc
      language: ruby
      rvm: ruby-2.0.0-p353
      env: BINDINGS=ruby
    - compiler: clang
      language: ruby
      rvm: ruby-2.0.0-p353
      env: BINDINGS=ruby CC="clang --coverage"
    - compiler: gcc
      language: ruby
      rvm: ruby-2.1.0
      env: BINDINGS=ruby
    - compiler: clang
      language: ruby
      rvm: ruby-2.1.0
      env: BINDINGS=ruby CC="clang --coverage"
    - compiler: gcc
      language: python
      python: "2.7"
      env: BINDINGS=python
    - compiler: clang
      language: python
      python: "2.7"
      env: BINDINGS=python CC="clang --coverage"
    - compiler: gcc
      language: perl
      perl: "5.18"
      env: BINDINGS=perl
    - compiler: clang
      language: perl
      perl: "5.18"
      env: BINDINGS=perl CC="clang --coverage"
    - compiler: gcc
      language: perl
      perl: "5.14"
      env: BINDINGS=perl
    - compiler: clang
      language: perl
      perl: "5.14"
      env: BINDINGS=perl CC="clang --coverage"
    - compiler: gcc
      language: perl
      perl: "5.10"
      env: BINDINGS=perl
    - compiler: clang
      language: perl
      perl: "5.10"
      env: BINDINGS=perl CC="clang --coverage"
    - compiler: gcc
      language: php
      php: "5.5"
      env: BINDINGS=php
    - compiler: clang
      language: php
      php: "5.5"
      env: BINDINGS=php CC="clang --coverage"
    - compiler: gcc
      language: php
      php: "5.4"
      env: BINDINGS=php
    - compiler: clang
      language: php
      php: "5.4"
      env: BINDINGS=php CC="clang --coverage"
    - compiler: gcc
      language: dotnet
      env: BINDINGS=dotnet
    - compiler: clang
      language: dotnet
      env: BINDINGS=dotnet CC="clang --coverage"
    - compiler: gcc
      language: cpp
      env: BINDINGS=cpp
    - compiler: gcc
      language: cpp
      env: BINDINGS=cpp CC="clang --coverage"
before_install:
  - if [ "$CC" == "clang" ]; then export CC="clang --coverage"; fi
  - sudo apt-get update -qq
  - sudo apt-get install lcov
  - gem install coveralls-lcov
  - if [ "$BINDINGS" != "none" ]; then sudo apt-get install -qq swig; fi
  - if [ "$BINDINGS" == "perl" ]; then sudo add-apt-repository ppa:dns/irc -y; sudo apt-get update -qq; sudo apt-get install -qq swig=2.0.8-1irc1~12.04; fi
  - if [ "$BINDINGS" == "python" ]; then sudo apt-get install -qq python-dev; fi
  - if [ "$BINDINGS" == "dotnet" ]; then sudo add-apt-repository ppa:directhex/monoxide -y; sudo apt-get update -qq; sudo apt-get install -qq mono-devel mono-mcs nunit nunit-console; mozroots --import --sync; fi
install: true
before_script:
  - if [ "$BINDINGS" == "php" ]; then phpenv config-add src/bindings/php/hammer.ini; fi
script: 
  - scons bindings=$BINDINGS test --variant=debug --coverage
after_success:
  - if [ "$CC" == "clang --coverage" ]; then llvm-cov gcov -o coverage.info build/debug/src/test_suite.gcda; else lcov --capture --directory build/debug/src --output-file coverage.info; fi
  - coveralls-lcov coverage.info
notifications:
  irc: 
    channels: 
      - "irc.upstandinghackers.com#hammer"
    use_notice: true
    skip_join: true
