protobuf/internal.bzl
Derek Perez bc45f92262
Bazel powered Java testing (#8506)
* Protobuf Java/Core Tests running w/ Bazel.

Also integrates rules_jvm_external and migrates existing maven deps
in place.

* Add test_suite target that maps to rule name.

* Lite tests passing in Bazel

* util tests passing with Bazel.

* Add conformance and build testing to //java:core

* Cleanup bzl style and lock down access to failure lists.

* Adding Java Lite conformance tests.

* rm newline

* parameterize conformance_test

This makes usage of failure lists more explicit.

* restrict visibility more for newly added libs and fix formatting.

* fix formatting and visibility.

* move testing.bzl to an internal package.

* fix file formatting.

* moving conformance_test to internal.bzl
2021-04-20 11:36:32 -07:00

30 lines
1.0 KiB
Python

# PLEASE DO NOT DEPEND ON THE CONTENTS OF THIS FILE, IT IS UNSTABLE.
def conformance_test(name, testee, failure_list = None, text_format_failure_list = None):
args = ["--testee %s" % _strip_bazel(testee)]
failure_lists = []
if failure_list:
args = args + ["--failure_list %s" % _strip_bazel(failure_list)]
failure_lists = failure_lists + [failure_list]
if text_format_failure_list:
args = args + ["--text_format_failure_list %s" % _strip_bazel(text_format_failure_list)]
failure_lists = failure_lists + [text_format_failure_list]
native.sh_test(
name = name,
srcs = ["//:conformance/conformance_test_runner.sh"],
data = [testee] + failure_lists + [
"//:conformance_test_runner",
],
args = args,
deps = [
"@bazel_tools//tools/bash/runfiles",
],
)
def _strip_bazel(testee):
if testee.startswith("//"):
testee = testee.replace("//", "com_google_protobuf")
return testee.replace(":", "/")