Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky2017-03-18 15:13:26 +0000
committerMatthias Sohn2017-03-21 08:24:12 +0000
commit0f6ddb372bc24a010c85849dfc80f72fc8cd604d (patch)
tree9b25cdc0b3e54803902559b7c3eeb82627fb0513 /org.eclipse.jgit.test/tests.bzl
parentcee9d444e97858d441b5de0f4c357bccbe4952f2 (diff)
downloadjgit-0f6ddb372bc24a010c85849dfc80f72fc8cd604d.tar.gz
jgit-0f6ddb372bc24a010c85849dfc80f72fc8cd604d.tar.xz
jgit-0f6ddb372bc24a010c85849dfc80f72fc8cd604d.zip
Add remaining parts of the bazel build
Add bazel build for ui and junit.http, and the test packages. A number of different test labels are supported: api attributes dfs diff http lfs lfs-server nls notes pack patch pgm reftree revplot revwalk storage submodule symlinks transport treewalk util To run all tests: bazel test //... To run specific tests, using labels: bazel test --test_tag_filters=api,dfs,revplot,treewalk //... Change-Id: Ic41b05a79d855212e67b1b4707e9c6b4dc9ea70d Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'org.eclipse.jgit.test/tests.bzl')
-rw-r--r--org.eclipse.jgit.test/tests.bzl51
1 files changed, 51 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tests.bzl b/org.eclipse.jgit.test/tests.bzl
new file mode 100644
index 0000000000..d5cc2c9868
--- /dev/null
+++ b/org.eclipse.jgit.test/tests.bzl
@@ -0,0 +1,51 @@
+load(
+ "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
+ "junit_tests",
+)
+
+def tests(tests):
+ for src in tests:
+ name = src[len('tst/'):len(src)-len('.java')].replace('/', '_')
+ labels = []
+ if name.startswith('org_eclipse_jgit_'):
+ l = name[len('org.eclipse.jgit_'):]
+ if l.startswith('internal_storage_'):
+ l = l[len('internal.storage_'):]
+ i = l.find('_')
+ if i > 0:
+ labels.append(l[:i])
+ else:
+ labels.append(i)
+ if 'lib' not in labels:
+ labels.append('lib')
+
+ additional_deps = []
+ if src.endswith("RootLocaleTest.java"):
+ additional_deps = [
+ '//org.eclipse.jgit.pgm:pgm',
+ '//org.eclipse.jgit.ui:ui',
+ ]
+ if src.endswith("WalkEncryptionTest.java"):
+ additional_deps = [
+ '//org.eclipse.jgit:insecure_cipher_factory',
+ ]
+
+ junit_tests(
+ name = name,
+ tags = labels,
+ srcs = [src],
+ deps = additional_deps + [
+ ':helpers',
+ ':tst_rsrc',
+ '//org.eclipse.jgit:jgit',
+ '//org.eclipse.jgit.junit:junit',
+ '//org.eclipse.jgit.lfs:jgit-lfs',
+ '@hamcrest_core//jar',
+ '@hamcrest_library//jar',
+ '@javaewah//jar',
+ '@junit//jar',
+ '@log_api//jar',
+ '@slf4j_simple//jar',
+ ],
+ jvm_flags = ["-Xmx256m", "-Dfile.encoding=UTF-8"],
+ )

Back to the top