aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tests.bzl
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test/tests.bzl')
-rw-r--r--org.eclipse.jgit.test/tests.bzl24
1 files changed, 22 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tests.bzl b/org.eclipse.jgit.test/tests.bzl
index 170bf0c460..41f76d090a 100644
--- a/org.eclipse.jgit.test/tests.bzl
+++ b/org.eclipse.jgit.test/tests.bzl
@@ -1,11 +1,29 @@
+'''
+Expose each test as a bazel target
+'''
load(
"@com_googlesource_gerrit_bazlets//tools:junit.bzl",
"junit_tests",
)
-def tests(tests):
+def tests(tests, srcprefix="tst/", extra_tags=[]):
+ '''
+ Create a target each of the tests
+
+ Each target is the full push (removing srcprefix) replacing directory
+ separators with underscores.
+
+ e.g. a test under tst/a/b/c/A.test will become the target
+ //org.eclipse.jgit.tests:a_b_c_A
+
+ Args:
+ tests: a glob of tests files
+ srcprefix: prefix between org.eclipse.jgit.tests and the package
+ start
+ extra_tags: additional tags to add to the generated targets
+ '''
for src in tests:
- name = src[len("tst/"):len(src) - len(".java")].replace("/", "_")
+ name = src[len(srcprefix):len(src) - len(".java")].replace("/", "_")
labels = []
timeout = "moderate"
if name.startswith("org_eclipse_jgit_"):
@@ -20,6 +38,8 @@ def tests(tests):
if "lib" not in labels:
labels.append("lib")
+ labels.extend(extra_tags)
+
# TODO(http://eclip.se/534285): Make this test pass reliably
# and remove the flaky attribute.
flaky = src.endswith("CrissCrossMergeTest.java")