|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Copyright 2023 Code Intelligence GmbH |
| 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 | +# --- begin runfiles.bash initialization v3 --- |
| 17 | +# Copy-pasted from the Bazel Bash runfiles library v3. |
| 18 | +set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash |
| 19 | +source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ |
| 20 | + source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ |
| 21 | + source "$0.runfiles/$f" 2>/dev/null || \ |
| 22 | + source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ |
| 23 | + source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ |
| 24 | + { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e |
| 25 | +# --- end runfiles.bash initialization v3 --- |
| 26 | + |
| 27 | +# JAZZER_EXECPATH is a path of the form "external/remotejdk_17/bin/java". We need to strip of the |
| 28 | +# leading external to get a path we can pass to rlocation. |
| 29 | +java_rlocationpath=$(echo "$JAVA_EXECPATH" | cut -d/ -f2-) |
| 30 | +java=$(rlocation "$java_rlocationpath") |
| 31 | +jazzer=$(rlocation "$JAZZER_RLOCATIONPATH") |
| 32 | +[ -f "$jazzer" ] || exit 1 |
| 33 | +jazzer_version_output=$("$java" -jar "$jazzer" --version 2>&1) |
| 34 | +echo "$jazzer_version_output" |
| 35 | +echo "$jazzer_version_output" | tr -d '\n' | grep -q '^Jazzer v[0-9.]*$' || exit 1 |
0 commit comments