generate_tests.bzl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/env python2.7
  2. # Copyright 2015 gRPC authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. """Generates the appropriate build.json data for all the bad_client tests."""
  16. load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test")
  17. def test_options():
  18. return struct()
  19. # maps test names to options
  20. BAD_CLIENT_TESTS = {
  21. "badreq": test_options(),
  22. "bad_streaming_id": test_options(),
  23. "connection_prefix": test_options(),
  24. "duplicate_header": test_options(),
  25. "headers": test_options(),
  26. "initial_settings_frame": test_options(),
  27. "head_of_line_blocking": test_options(),
  28. "large_metadata": test_options(),
  29. "out_of_bounds": test_options(),
  30. "server_registered_method": test_options(),
  31. "simple_request": test_options(),
  32. "window_overflow": test_options(),
  33. "unknown_frame": test_options(),
  34. }
  35. # buildifier: disable=unnamed-macro
  36. def grpc_bad_client_tests():
  37. grpc_cc_library(
  38. name = "bad_client_test",
  39. srcs = ["bad_client.cc"],
  40. hdrs = ["bad_client.h"],
  41. language = "C++",
  42. deps = ["//test/core/util:grpc_test_util", "//:grpc", "//:gpr", "//test/core/end2end:cq_verifier"],
  43. )
  44. for t, topt in BAD_CLIENT_TESTS.items():
  45. grpc_cc_test(
  46. name = "%s_bad_client_test" % t,
  47. srcs = ["tests/%s.cc" % t],
  48. deps = [":bad_client_test"],
  49. external_deps = [
  50. "gtest",
  51. ],
  52. )