Bump to gtest 1.10.0
[platform/upstream/gtest.git] / ci / env-osx.sh
similarity index 63%
rename from xcode/Samples/FrameworkSample/runtests.sh
rename to ci/env-osx.sh
index 4a0d413..9c421e1 100755 (executable)
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/usr/bin/env bash
+# Copyright 2017 Google Inc.
+# All Rights Reserved.
 #
-# Copyright 2008, Google Inc.
-# All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# Executes the samples and tests for the Google Test Framework.
-
-# Help the dynamic linker find the path to the libraries.
-export DYLD_FRAMEWORK_PATH=$BUILT_PRODUCTS_DIR
-export DYLD_LIBRARY_PATH=$BUILT_PRODUCTS_DIR
-
-# Create some executables.
-test_executables=$@
+#
+# This file should be sourced, and not executed as a standalone script.
+#
 
-# Now execute each one in turn keeping track of how many succeeded and failed.
-succeeded=0
-failed=0
-failed_list=()
-for test in ${test_executables[*]}; do
-  "$test"
-  result=$?
-  if [ $result -eq 0 ]; then
-    succeeded=$(( $succeeded + 1 ))
-  else
-    failed=$(( failed + 1 ))
-    failed_list="$failed_list $test"
-  fi
-done
+# TODO() - we can check if this is being sourced using $BASH_VERSION and $BASH_SOURCE[0] != ${0}.
+#
 
-# Report the successes and failures to the console.
-echo "Tests complete with $succeeded successes and $failed failures."
-if [ $failed -ne 0 ]; then
-  echo "The following tests failed:"
-  echo $failed_list
+if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+    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
-exit $failed