diff --git a/.travis.yml b/.travis.yml index 9e39083a..ee64c6e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,12 +50,11 @@ matrix: # OSX ############################################################################ - # FIXME: Error exit code when installing OpenCV with Brew # OSX build - #- os: osx - #compiler: clang - #env: - #- ENV_CXX_FLAGS="-Wno-c99-extensions" + - os: osx + compiler: clang + env: + - ENV_CXX_FLAGS="-Wno-c99-extensions" ############################################################################ # POCL builds (OpenCL 1.0, 1.1) @@ -242,7 +241,9 @@ before_install: brew update brew outdated boost || brew upgrade boost brew outdated cmake || brew upgrade cmake - brew install lcov opencv # FIXME: exit status 1 with no error message + brew list lcov >/dev/null 2>&1 || brew install lcov + # The old Homebrew OpenCV install was the failure that forced the macOS + # job to be disabled. Keep the rest of the macOS bootstrap intact. fi - gem install coveralls-lcov - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi diff --git a/scripts/validate-travis-macos.sh b/scripts/validate-travis-macos.sh new file mode 100755 index 00000000..bbdc8933 --- /dev/null +++ b/scripts/validate-travis-macos.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# Validate the macOS Travis matrix fix for issue #35. +set -euo pipefail + +root="$(cd "$(dirname "$0")/.." && pwd)" +cd "$root" + +echo "==> YAML parse" +ruby -e 'require "yaml"; YAML.load_file(".travis.yml"); puts "yaml ok"' + +echo "==> macOS matrix entry enabled" +grep -q '^[[:space:]]*- os: osx' .travis.yml || { + echo "FAIL: expected active '- os: osx' matrix entry" + exit 1 +} + +echo "==> macOS before_install skips Homebrew OpenCV" +macos_block="$(awk '/TRAVIS_OS_NAME.*osx/,/fi/ {print}' .travis.yml)" + +for expected in \ + 'brew update' \ + 'brew outdated boost || brew upgrade boost' \ + 'brew outdated cmake || brew upgrade cmake' \ + 'brew list lcov >/dev/null 2>&1 || brew install lcov' +do + if ! grep -Fq "$expected" <<<"$macos_block"; then + echo "FAIL: macOS block is missing expected command: $expected" + exit 1 + fi +done + +if grep -q 'brew install.*opencv' <<<"$macos_block"; then + echo "FAIL: macOS block still runs 'brew install ... opencv'" + exit 1 +fi + +echo "==> whitespace" +git diff --check + +echo "All checks passed."