BUILD 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Copyright 2017 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. load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_test", "grpc_package", "grpc_sh_test")
  15. licenses(["notice"])
  16. grpc_package(name = "test/cpp/codegen")
  17. grpc_cc_test(
  18. name = "codegen_test_full",
  19. srcs = ["codegen_test_full.cc"],
  20. external_deps = [
  21. "gtest",
  22. ],
  23. uses_polling = False,
  24. deps = [
  25. "//:grpc++",
  26. "//test/core/util:grpc_test_util",
  27. ],
  28. )
  29. grpc_cc_test(
  30. name = "codegen_test_minimal",
  31. srcs = ["codegen_test_minimal.cc"],
  32. external_deps = [
  33. "gtest",
  34. ],
  35. uses_polling = False,
  36. deps = [
  37. "//:grpc++",
  38. "//test/core/util:grpc_test_util",
  39. ],
  40. )
  41. grpc_cc_test(
  42. name = "proto_utils_test",
  43. srcs = ["proto_utils_test.cc"],
  44. external_deps = [
  45. "gtest",
  46. "protobuf",
  47. ],
  48. uses_polling = False,
  49. deps = [
  50. "//:grpc++",
  51. "//test/core/util:grpc_test_util",
  52. ],
  53. )
  54. grpc_cc_binary(
  55. name = "golden_file_test",
  56. testonly = True,
  57. srcs = ["golden_file_test.cc"],
  58. external_deps = [
  59. "absl/flags:flag",
  60. "gtest",
  61. ],
  62. deps = [
  63. "//:grpc++",
  64. "//test/core/util:grpc_test_util",
  65. "//test/cpp/util:test_config",
  66. ],
  67. )
  68. genrule(
  69. name = "copy_compiler_test_grpc_pb_h",
  70. srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
  71. outs = ["compiler_test.grpc.pb.h"],
  72. cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.h > $@",
  73. )
  74. genrule(
  75. name = "copy_compiler_test_mock_grpc_pb_h",
  76. srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
  77. outs = ["compiler_test_mock.grpc.pb.h"],
  78. cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test_mock.grpc.pb.h > $@",
  79. )
  80. grpc_sh_test(
  81. name = "run_golden_file_test",
  82. srcs = ["run_golden_file_test.sh"],
  83. data = [
  84. ":compiler_test.grpc.pb.h",
  85. ":compiler_test_golden",
  86. ":compiler_test_mock.grpc.pb.h",
  87. ":compiler_test_mock_golden",
  88. ":golden_file_test",
  89. ],
  90. )