# Copyright (c) 2013 Mathieu Turcotte
# Licensed under the MIT license.

language: go

addons:
    hosts:
        - hpenvy.local
        - bc0.hpenvy.local
        - bc1.hpenvy.local
        - bc2.hpenvy.local

# phantomjs 1.9 is required for the system.stdout.write call.
# TODO: Remove once travis-ci updates to phantomjs 1.9.
before_install:
  - phantomjs --version
  - wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2
  - tar -xf phantomjs-1.9.0-linux-x86_64.tar.bz2

before_script:
    - go run src/github.com/MathieuTurcotte/go-browserchannel/test/server/server.go
        --public_directory=$TRAVIS_BUILD_DIR/test/client
        --closure_directory=$TRAVIS_BUILD_DIR/closure-library
        --port=8080 &> server.log &

script:
    - go test -v github.com/MathieuTurcotte/go-browserchannel/browserchannel/...
    - phantomjs-1.9.0-linux-x86_64/bin/phantomjs $TRAVIS_BUILD_DIR/test/runner.js


# Copyright (c) 2013 Mathieu Turcotte
# Licensed under the MIT license.

language: go

addons:
    hosts:
        - hpenvy.local
        - bc0.hpenvy.local
        - bc1.hpenvy.local
        - bc2.hpenvy.local

# phantomjs 1.9 is required for the system.stdout.write call.
# TODO: Remove once travis-ci updates to phantomjs 1.9.
before_install:
  - phantomjs --version
  - wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2
  - tar -xf phantomjs-1.9.0-linux-x86_64.tar.bz2

before_script:
    - go run src/github.com/MathieuTurcotte/go-browserchannel/test/server/server.go
        --public_directory=$TRAVIS_BUILD_DIR/test/client
        --closure_directory=$TRAVIS_BUILD_DIR/closure-library
        --port=8080 &> server.log &

script:
    - go test -v github.com/MathieuTurcotte/go-browserchannel/browserchannel/...
    - phantomjs-1.9.0-linux-x86_64/bin/phantomjs $TRAVIS_BUILD_DIR/test/runner.js

after_failure:
    - cat server.log

Print server log on failure.
Print server log on failure.
