diff options
author | Enji Cooper <yaneurabeya@gmail.com> | 2019-01-13 01:16:29 (GMT) |
---|---|---|
committer | Enji Cooper <yaneurabeya@gmail.com> | 2019-02-04 20:19:27 (GMT) |
commit | 9df5475b8267e3b6e485bcb55febd208149e96af (patch) | |
tree | 292140dc6409f8972678a801d37ce65e5054482a /ci/env-osx.sh | |
parent | 0ea2d8f8fa1601abb9ce713b7414e7b86f90bc61 (diff) | |
download | googletest-9df5475b8267e3b6e485bcb55febd208149e96af.zip googletest-9df5475b8267e3b6e485bcb55febd208149e96af.tar.gz googletest-9df5475b8267e3b6e485bcb55febd208149e96af.tar.bz2 |
Test out changes with clang/OSX each PR using Travis CIrefs/pull/2100/head
This will help ensure that test coverage isn't missed when changes that
can impact OSX with clang are submitted. Although not perfect, testing
changes on OSX with clang is an ok proxy [for now] for testing changes on
FreeBSD with clang (testing on FreeBSD is non-trivial, as Travis CI doesn't
support operating systems other than Linux and OSX).
In order to support this, install the packages via homebrew using a
`addons::homebrew::packages` block (similar to `addons::apt::packages`
for Ubuntu), as documented in the Travis CI docs
( https://docs.travis-ci.com/user/installing-dependencies/ ). While
here, try pushing apt* calls into the Travis config for Ubuntu, instead
of delaying the equivalent calls in the `ci/*.sh` scripts. Keep the
`ci/*.sh` scripts for ease of testing locally (and extend the OSX one to
install gcc 4.9 and llvm 3.9, like the travis config does).
In order to accomodate this change (and because the homebrew package for
llvm@3.9 doesn't automatically add clang*-3.9 to `$PATH`), `$PATH` needs
to be adjusted to find the llvm@3.9 toolchain.
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Diffstat (limited to 'ci/env-osx.sh')
-rwxr-xr-x | ci/env-osx.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ci/env-osx.sh b/ci/env-osx.sh index 03c2d15..9c421e1 100755 --- a/ci/env-osx.sh +++ b/ci/env-osx.sh @@ -37,5 +37,11 @@ # if [ "${TRAVIS_OS_NAME}" = "osx" ]; then - if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.9" CC="clang-3.9"; fi + if [ "$CXX" = "clang++" ]; then + # $PATH needs to be adjusted because the llvm tap doesn't install the + # package to /usr/local/bin, etc, like the gcc tap does. + # See: https://github.com/Homebrew/legacy-homebrew/issues/29733 + clang_version=3.9 + export PATH="/usr/local/opt/llvm@${clang_version}/bin:$PATH"; + fi fi |