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