Skip to content
Open
Show file tree
Hide file tree
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
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions scripts/validate-travis-macos.sh
Original file line number Diff line number Diff line change
@@ -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."