internal.bzl 1.0 KB

1234567891011121314151617181920212223242526272829
  1. # PLEASE DO NOT DEPEND ON THE CONTENTS OF THIS FILE, IT IS UNSTABLE.
  2. def conformance_test(name, testee, failure_list = None, text_format_failure_list = None):
  3. args = ["--testee %s" % _strip_bazel(testee)]
  4. failure_lists = []
  5. if failure_list:
  6. args = args + ["--failure_list %s" % _strip_bazel(failure_list)]
  7. failure_lists = failure_lists + [failure_list]
  8. if text_format_failure_list:
  9. args = args + ["--text_format_failure_list %s" % _strip_bazel(text_format_failure_list)]
  10. failure_lists = failure_lists + [text_format_failure_list]
  11. native.sh_test(
  12. name = name,
  13. srcs = ["//:conformance/conformance_test_runner.sh"],
  14. data = [testee] + failure_lists + [
  15. "//:conformance_test_runner",
  16. ],
  17. args = args,
  18. deps = [
  19. "@bazel_tools//tools/bash/runfiles",
  20. ],
  21. )
  22. def _strip_bazel(testee):
  23. if testee.startswith("//"):
  24. testee = testee.replace("//", "com_google_protobuf")
  25. return testee.replace(":", "/")