forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprotoxform_test.sh
executable file
·33 lines (27 loc) · 1.52 KB
/
protoxform_test.sh
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
#!/bin/bash
set -e
rm -rf bazel-bin/tools
read -ra BAZEL_BUILD_OPTIONS <<< "${BAZEL_BUILD_OPTIONS:-}"
BAZEL_BUILD_OPTIONS+=("--remote_download_outputs=all")
TOOLS="$(dirname "$(dirname "$(realpath "$0")")")"
# to satisfy dependency on run_command
export PYTHONPATH="$TOOLS"
# protoxform fix test cases
PROTO_TARGETS=()
protos=$(bazel query "labels(srcs, labels(deps, //tools/testdata/protoxform:fix_protos))")
while read -r line; do PROTO_TARGETS+=("$line"); done \
<<< "$protos"
bazel build "${BAZEL_BUILD_OPTIONS[@]}" --//tools/api_proto_plugin:default_type_db_target=//tools/testdata/protoxform:fix_protos \
//tools/testdata/protoxform:fix_protos --aspects //tools/protoxform:protoxform.bzl%protoxform_aspect --output_groups=proto
bazel build "${BAZEL_BUILD_OPTIONS[@]}" //tools/protoxform:protoprint
./tools/protoxform/protoxform_test_helper.py fix "${PROTO_TARGETS[@]}"
# protoxform freeze test cases
PROTO_TARGETS=()
protos=$(bazel query "labels(srcs, labels(deps, //tools/testdata/protoxform:freeze_protos))")
while read -r line; do PROTO_TARGETS+=("$line"); done \
<<< "$protos"
bazel build "${BAZEL_BUILD_OPTIONS[@]}" --//tools/api_proto_plugin:default_type_db_target=//tools/testdata/protoxform:freeze_protos \
--//tools/api_proto_plugin:extra_args=freeze \
//tools/testdata/protoxform:freeze_protos --aspects //tools/protoxform:protoxform.bzl%protoxform_aspect --output_groups=proto
bazel build "${BAZEL_BUILD_OPTIONS[@]}" //tools/protoxform:protoprint
./tools/protoxform/protoxform_test_helper.py freeze "${PROTO_TARGETS[@]}"