Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis CI: add test configuration for Mac OS X. #175

Merged
merged 2 commits into from
Mar 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,33 @@ language: cpp

os:
- linux
- osx

# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
sudo: required
dist: trusty

env:
# Each line is a set of environment variables set before a build.
# Thus each line represents a different build configuration.
- SHADERC_BUILD_TYPE=Release SHADERC_CODE_COVERAGE=OFF
- SHADERC_BUILD_TYPE=Debug SHADERC_CODE_COVERAGE=OFF
- SHADERC_BUILD_TYPE=Debug SHADERC_CODE_COVERAGE=ON
- SHADERC_BUILD_TYPE=Release
- SHADERC_BUILD_TYPE=Debug

compiler:
- clang
- gcc

matrix:
fast_finish: true # Show final status immediately if a test fails.
exclude:
# Skip GCC builds on Mac OS X.
- os: osx
compiler: gcc
include:
# Additional GCC builds for code coverage.
- os: linux
compiler: gcc
env: SHADERC_CODE_COVERAGE=ON


cache:
apt: true

Expand All @@ -34,12 +45,19 @@ addons:
- ninja-build
- lcov

before_install:
# Install ninja on Mac OS X.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ninja; fi

install:
- pip install --user nose
- pip install --user cpp-coveralls

- export PATH=$HOME/.local/bin:$PATH # Make sure we can find the above Python packages
- if [ "$CC" = "clang" ]; then export CC=clang-3.6 CXX=clang++-3.6; fi # Make sure that clang-3.6 is selected.
# Make sure that clang-3.6 is selected.
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
export CC=clang-3.6 CXX=clang++-3.6;
fi

before_script:
- git clone https://github.com/google/googletest.git third_party/googletest
Expand All @@ -48,14 +66,14 @@ before_script:

script:
- mkdir build && cd build
- cmake -GNinja -DCMAKE_BUILD_TYPE=${SHADERC_BUILD_TYPE} -DENABLE_CODE_COVERAGE=${SHADERC_CODE_COVERAGE} ..
- cmake -GNinja -DCMAKE_BUILD_TYPE=${SHADERC_BUILD_TYPE:-Debug} -DENABLE_CODE_COVERAGE=${SHADERC_CODE_COVERAGE:-OFF} ..
- ninja
- ctest -j`nproc` --output-on-failure

after_success:
# Collect coverage and push to coveralls.info.
# Ignore third party source code and tests.
- if [ "$CC" = "gcc" -a "$SHADERC_CODE_COVERAGE" = "ON" ]; then
- if [[ "$CC" == "gcc" && "$SHADERC_CODE_COVERAGE" == "ON" ]]; then
coveralls
--root ../
--build-root ./
Expand Down