File: bazel_conformance_test_runner.sh

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (66 lines) | stat: -rwxr-xr-x 2,211 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# This is an internal file that should only be called from Bazel rules.  For
# custom conformance tests outside of Bazel use CMAKE with
# -Dprotobuf_BUILD_CONFORMANCE=ON to build the test runner.

set -x
echo $@

set -euo pipefail
# --- begin runfiles.bash initialization ---
if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
    if [[ -f "$0.runfiles_manifest" ]]; then
      export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
    elif [[ -f "$0.runfiles/MANIFEST" ]]; then
      export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST"
    elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
      export RUNFILES_DIR="$0.runfiles"
    fi
fi
if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
  source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash"
elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
  source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \
            "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)"
else
  echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash"
  exit 1
fi
# --- end runfiles.bash initialization ---

TESTEE=
FAILURE_LIST=
TEXT_FORMAT_FAILURE_LIST=
MAXIMUM_EDITION=

while [[ -n "$@" ]]; do
  arg="$1"; shift
  val="$1"; shift
  case "$arg" in
    "--testee") TESTEE="$val" ;;
    "--failure_list") FAILURE_LIST="$val" ;;
    "--text_format_failure_list") TEXT_FORMAT_FAILURE_LIST="$val" ;;
    "--maximum_edition") MAXIMUM_EDITION="$val" ;;
    *) echo "Flag $arg is not recognized." && exit 1 ;;
  esac
done

conformance_test_runner=$(rlocation com_google_protobuf/conformance/conformance_test_runner)
conformance_testee=$TESTEE
args=(--enforce_recommended)

failure_list=$FAILURE_LIST || unset
if [ -n "$failure_list" ] ; then
  args+=(--failure_list $failure_list)
fi

text_format_failure_list=$TEXT_FORMAT_FAILURE_LIST || unset
if [ -n "$text_format_failure_list" ]; then
  args+=(--text_format_failure_list $text_format_failure_list)
fi

if [ -n "$MAXIMUM_EDITION" ]; then
  args+=(--maximum_edition $MAXIMUM_EDITION)
fi

$conformance_test_runner "${args[@]}" $conformance_testee