xref: /JGit/org.eclipse.jgit.test/BUILD (revision 7755645777d89cfbd9f553bc394a52bb892b6c59)
10f6ddb37SDavid Ostrovskyload(
20f6ddb37SDavid Ostrovsky    "@com_googlesource_gerrit_bazlets//tools:genrule2.bzl",
30f6ddb37SDavid Ostrovsky    "genrule2",
40f6ddb37SDavid Ostrovsky)
522973d13SMatthias Sohnload("@rules_java//java:defs.bzl", "java_import", "java_library")
69150caa8SDavid Pursehouseload(":tests.bzl", "tests")
70f6ddb37SDavid Ostrovsky
80f6ddb37SDavid OstrovskyPKG = "tst/org/eclipse/jgit/"
90f6ddb37SDavid Ostrovsky
10488d9557SThomas WolfHELPERS = glob(
11488d9557SThomas Wolf    ["src/**/*.java"],
12f4c0189fSDavid Pursehouse    exclude = ["src/org/eclipse/jgit/transport/ssh/*.java"],
13488d9557SThomas Wolf) + [PKG + c for c in [
140f6ddb37SDavid Ostrovsky    "api/AbstractRemoteCommandTest.java",
150f6ddb37SDavid Ostrovsky    "diff/AbstractDiffTestCase.java",
16*8ad53baaSMatthias Sohn    "internal/revwalk/ObjectReachabilityTestCase.java",
17*8ad53baaSMatthias Sohn    "internal/revwalk/ReachabilityCheckerTestCase.java",
180f6ddb37SDavid Ostrovsky    "internal/storage/file/GcTestCase.java",
190f6ddb37SDavid Ostrovsky    "internal/storage/file/PackIndexTestCase.java",
200f6ddb37SDavid Ostrovsky    "internal/storage/file/XInputStream.java",
210f6ddb37SDavid Ostrovsky    "nls/GermanTranslatedBundle.java",
220f6ddb37SDavid Ostrovsky    "nls/MissingPropertyBundle.java",
230f6ddb37SDavid Ostrovsky    "nls/NoPropertiesBundle.java",
240f6ddb37SDavid Ostrovsky    "nls/NonTranslatedBundle.java",
250f6ddb37SDavid Ostrovsky    "revwalk/RevQueueTestCase.java",
260f6ddb37SDavid Ostrovsky    "revwalk/RevWalkTestCase.java",
27a6da0591SDavid Pursehouse    "transport/ObjectIdMatcher.java",
28208ddab5SIvan Frade    "transport/RequestValidatorTestCase.java",
290f6ddb37SDavid Ostrovsky    "transport/SpiTransport.java",
300f6ddb37SDavid Ostrovsky    "treewalk/filter/AlwaysCloneTreeFilter.java",
310f6ddb37SDavid Ostrovsky    "test/resources/SampleDataRepositoryTestCase.java",
320f6ddb37SDavid Ostrovsky    "util/CPUTimeStopWatch.java",
336518d633SDavid Pursehouse    "util/http/HttpCookiesMatcher.java",
340f6ddb37SDavid Ostrovsky    "util/io/Strings.java",
350f6ddb37SDavid Ostrovsky]]
360f6ddb37SDavid Ostrovsky
370f6ddb37SDavid OstrovskyDATA = [
380f6ddb37SDavid Ostrovsky    PKG + "lib/empty.gitindex.dat",
390f6ddb37SDavid Ostrovsky    PKG + "lib/sorttest.gitindex.dat",
400f6ddb37SDavid Ostrovsky]
410f6ddb37SDavid Ostrovsky
42cee26c00SMatthias SohnEXCLUDED = [
43cee26c00SMatthias Sohn    PKG + "api/SecurityManagerTest.java",
449b2f8cedSDavid Ostrovsky    PKG + "api/SecurityManagerMissingPermissionsTest.java",
45cee26c00SMatthias Sohn]
46cee26c00SMatthias Sohn
47bbef67e8SDavid Ostrovskytests(tests = glob(
480f6ddb37SDavid Ostrovsky    ["tst/**/*.java"],
49cee26c00SMatthias Sohn    exclude = HELPERS + DATA + EXCLUDED,
500f6ddb37SDavid Ostrovsky))
510f6ddb37SDavid Ostrovsky
520f6ddb37SDavid Ostrovskyjava_library(
530f6ddb37SDavid Ostrovsky    name = "helpers",
540f6ddb37SDavid Ostrovsky    testonly = 1,
550f6ddb37SDavid Ostrovsky    srcs = HELPERS,
560f6ddb37SDavid Ostrovsky    resources = DATA,
570f6ddb37SDavid Ostrovsky    deps = [
588ada9048SMatthias Sohn        "//lib:assertj-core",
5928cfda54SDavid Pursehouse        "//lib:junit",
602532fa74SMatthias Sohn        "//lib:mockito",
611fd09a19SDavid Pursehouse        "//lib:slf4j-simple",
620f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit:jgit",
630f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit.junit:junit",
640f6ddb37SDavid Ostrovsky    ],
650f6ddb37SDavid Ostrovsky)
660f6ddb37SDavid Ostrovsky
670f6ddb37SDavid Ostrovskyjava_import(
680f6ddb37SDavid Ostrovsky    name = "tst_rsrc",
690f6ddb37SDavid Ostrovsky    jars = [":tst_rsrc_jar"],
700f6ddb37SDavid Ostrovsky)
710f6ddb37SDavid Ostrovsky
720f6ddb37SDavid Ostrovskygenrule2(
73904e9f8bSDavid Pursehouse    name = "tst_rsrc_jar",
74904e9f8bSDavid Pursehouse    srcs = glob(["tst-rsrc/**"]),
75904e9f8bSDavid Pursehouse    outs = ["tst_rsrc.jar"],
76904e9f8bSDavid Pursehouse    cmd = "o=$$PWD/$@ && tar cf - $(SRCS) | tar -C $$TMP --strip-components=2 -xf - && cd  $$TMP && zip -qr $$o .",
770f6ddb37SDavid Ostrovsky)
78