1# Copyright 2023 The Bazel Authors. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# --- begin runfiles.bash initialization v3 --- 16# Copy-pasted from the Bazel Bash runfiles library v3. 17set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash 18source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ 19 source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ 20 source "$0.runfiles/$f" 2>/dev/null || \ 21 source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ 22 source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ 23 { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e 24# --- end runfiles.bash initialization v3 --- 25set +e 26 27bin=$(rlocation _main/tests/base_rules/_run_zip_test_bin) 28if [[ -z "$bin" ]]; then 29 echo "Unable to locate test binary" 30 exit 1 31fi 32actual=$($bin) 33 34if [[ ! "$actual" == RULES_PYTHON_ZIP_DIR=/* ]]; then 35 echo "expected output: RULES_PYTHON_ZIP_DIR=<some path>" 36 echo "but got: $actual" 37 exit 1 38fi 39