macos_xcode_bazel.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. #
  3. # Copyright 2019 The Abseil Authors.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # https://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # This script is invoked on Kokoro to test Abseil on macOS.
  17. # It is not hermetic and may break when Kokoro is updated.
  18. set -euox pipefail
  19. if [[ -z ${ABSEIL_ROOT:-} ]]; then
  20. ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
  21. fi
  22. # If we are running on Kokoro, check for a versioned Bazel binary.
  23. KOKORO_GFILE_BAZEL_BIN="bazel-3.7.0-darwin-x86_64"
  24. if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then
  25. BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}"
  26. chmod +x ${BAZEL_BIN}
  27. else
  28. BAZEL_BIN="bazel"
  29. fi
  30. # Print the compiler and Bazel versions.
  31. echo "---------------"
  32. gcc -v
  33. echo "---------------"
  34. ${BAZEL_BIN} version
  35. echo "---------------"
  36. cd ${ABSEIL_ROOT}
  37. if [[ -n "${ALTERNATE_OPTIONS:-}" ]]; then
  38. cp ${ALTERNATE_OPTIONS:-} absl/base/options.h || exit 1
  39. fi
  40. ${BAZEL_BIN} test ... \
  41. --copt=-Werror \
  42. --keep_going \
  43. --show_timestamps \
  44. --test_env="TZDIR=${ABSEIL_ROOT}/absl/time/internal/cctz/testdata/zoneinfo" \
  45. --test_output=errors \
  46. --test_tag_filters=-benchmark