• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3set -x
4echo $@
5
6set -euo pipefail
7# --- begin runfiles.bash initialization ---
8if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
9    if [[ -f "$0.runfiles_manifest" ]]; then
10      export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
11    elif [[ -f "$0.runfiles/MANIFEST" ]]; then
12      export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST"
13    elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
14      export RUNFILES_DIR="$0.runfiles"
15    fi
16fi
17if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
18  source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash"
19elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
20  source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \
21            "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)"
22else
23  echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash"
24  exit 1
25fi
26# --- end runfiles.bash initialization ---
27
28TESTEE=unset
29FAILURE_LIST=unset
30TEXT_FORMAT_FAILURE_LIST=unset
31
32while [[ -n "$@" ]]; do
33  arg="$1"; shift
34  val="$1"; shift
35  case "$arg" in
36    "--testee") TESTEE="$val" ;;
37    "--failure_list") FAILURE_LIST="$val" ;;
38    "--text_format_failure_list") TEXT_FORMAT_FAILURE_LIST="$val" ;;
39    *) echo "Flag $arg is not recognized." && exit 1 ;;
40  esac
41done
42
43conformance_test_runner=$(rlocation com_google_protobuf/conformance_test_runner)
44conformance_testee=$(rlocation $TESTEE)
45args=(--enforce_recommended)
46
47failure_list=$(rlocation $FAILURE_LIST)
48if [ "$failure_list" != "1" ] ; then
49  args+=(--failure_list $failure_list)
50fi
51
52text_format_failure_list=$(rlocation $TEXT_FORMAT_FAILURE_LIST)
53if [ "$text_format_failure_list" != "1" ]; then
54  args+=(--text_format_failure_list $text_format_failure_list)
55fi
56
57$conformance_test_runner "${args[@]}" $conformance_testee
58