Lei Zhang | c4ebb55 | 2016-05-04 11:29:21 -0400 | [diff] [blame] | 1 | # Linux and Mac Build Configuration for Travis |
| 2 | |
| 3 | language: cpp |
| 4 | |
| 5 | os: |
| 6 | - linux |
| 7 | - osx |
| 8 | |
| 9 | # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment. |
| 10 | sudo: required |
| 11 | dist: trusty |
| 12 | |
| 13 | env: |
| 14 | - GLSLANG_BUILD_TYPE=Release |
| 15 | - GLSLANG_BUILD_TYPE=Debug |
| 16 | |
| 17 | compiler: |
| 18 | - clang |
| 19 | - gcc |
| 20 | |
| 21 | matrix: |
| 22 | fast_finish: true # Show final status immediately if a test fails. |
| 23 | exclude: |
| 24 | # Skip GCC builds on Mac OS X. |
| 25 | - os: osx |
| 26 | compiler: gcc |
| 27 | |
| 28 | cache: |
| 29 | apt: true |
| 30 | |
| 31 | branches: |
| 32 | only: |
| 33 | - master |
| 34 | |
| 35 | addons: |
| 36 | apt: |
| 37 | packages: |
| 38 | - clang-3.6 |
| 39 | - ninja-build |
| 40 | |
| 41 | install: |
| 42 | # Install ninja on Mac OS X. |
| 43 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ninja; fi |
| 44 | # Make sure that clang-3.6 is selected. |
| 45 | - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then |
| 46 | export CC=clang-3.6 CXX=clang++-3.6; |
| 47 | fi |
| 48 | |
| 49 | before_script: |
| 50 | - git clone https://github.com/google/googletest.git External/googletest |
| 51 | |
| 52 | script: |
| 53 | - mkdir build && cd build |
| 54 | # We need to install the compiled binaries so the paths in the runtests script can resolve correctly. |
| 55 | - cmake -GNinja -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=`pwd`/install .. |
| 56 | - ninja install |
| 57 | # Run Google-Test-based tests. |
| 58 | - ctest --output-on-failure |
| 59 | # Run runtests-based tests. |
| 60 | - cd ../Test && ./runtests |