• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The gRPC authors.
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
15load("@rules_python//python:defs.bzl", "py_test")
16load("//bazel:python_rules.bzl", "py_proto_library")
17
18package(default_testonly = 1)
19
20proto_library(
21    name = "simplest_proto",
22    testonly = True,
23    srcs = ["simplest.proto"],
24    strip_import_prefix = "/tools/distrib/python/grpcio_tools/grpc_tools/test/",
25)
26
27proto_library(
28    name = "complicated_proto",
29    testonly = True,
30    srcs = ["complicated.proto"],
31    strip_import_prefix = "/tools/distrib/python/grpcio_tools/grpc_tools/test/",
32    deps = [":simplest_proto"],
33)
34
35py_proto_library(
36    name = "complicated_py_pb2",
37    testonly = True,
38    deps = ["complicated_proto"],
39)
40
41py_test(
42    name = "protoc_test",
43    srcs = ["protoc_test.py"],
44    data = [
45        "complicated.proto",
46        "flawed.proto",
47        "simple.proto",
48        "simpler.proto",
49        "simplest.proto",
50    ],
51    python_version = "PY3",
52    deps = [
53        ":complicated_py_pb2",
54        "//tools/distrib/python/grpcio_tools:grpc_tools",
55    ],
56)
57