Brian Silverman | 7d89e28 | 2021-11-17 17:36:54 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # Copyright 2018 The Bazel Authors. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | set -euo pipefail |
| 17 | |
| 18 | toolchain_name="" |
| 19 | |
| 20 | while getopts "t:h" opt; do |
| 21 | case "$opt" in |
| 22 | "t") toolchain_name="$OPTARG";; |
| 23 | "h") echo "Usage:" |
| 24 | echo "-t - Toolchain name to use for testing; default is llvm_toolchain" |
| 25 | exit 2 |
| 26 | ;; |
| 27 | "?") echo "invalid option: -$OPTARG"; exit 1;; |
| 28 | esac |
| 29 | done |
| 30 | |
| 31 | source "$(dirname "${BASH_SOURCE[0]}")/bazel.sh" |
| 32 | "${bazel}" version |
| 33 | |
| 34 | set -x |
| 35 | test_args=( |
| 36 | --extra_toolchains="${toolchain_name}" |
| 37 | --copt=-v |
| 38 | --linkopt=-Wl,-t |
| 39 | ) |
| 40 | if [[ "${TEST_MIGRATION:-}" ]]; then |
| 41 | # We can not use bazelisk to test migration because bazelisk does not allow |
| 42 | # us to selectively ignore a migration flag. |
| 43 | test_args+=("--all_incompatible_changes") |
| 44 | # This flag is not quite ready -- https://github.com/bazelbuild/bazel/issues/7347 |
| 45 | test_args+=("--incompatible_disallow_struct_provider_syntax=false") |
| 46 | # the rules_rust repo included in the WORKSPACE is currently incompatible with |
| 47 | # '--incompatible_no_rule_outputs_param=true', setting this to false for now. |
| 48 | test_args+=("--incompatible_no_rule_outputs_param=false") |
| 49 | fi |
| 50 | "${bazel}" --bazelrc=/dev/null test "${common_test_args[@]}" "${test_args[@]}" //tests:all |