From 27b5e3eaba5514adc55718a8d963dfe8f5086663 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 17 Mar 2016 11:51:42 -0400 Subject: [PATCH 1/2] Travis CI: add configuration for testing on Mac OS X. --- .travis.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 209622a0f..48d7d166f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ language: cpp os: - linux + - osx # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment. sudo: required @@ -20,6 +21,12 @@ compiler: - clang - gcc +matrix: + exclude: + # Skip GCC builds on Mac OS X. + - os: osx + compiler: gcc + cache: apt: true @@ -34,12 +41,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 @@ -55,7 +69,7 @@ script: 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 ./ From 8bdb2085ef164760fba54e2187ed734f95199b8f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 17 Mar 2016 14:27:20 -0400 Subject: [PATCH 2/2] Travis CI: skip code coverage build for Clang. --- .travis.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 48d7d166f..d1a0b21b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,21 +11,25 @@ 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 @@ -62,7 +66,7 @@ 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