xref: /JGit/org.eclipse.jgit.test/BUILD (revision cee26c00372db1e0e4a9c3c68238607190380451)
10f6ddb37SDavid Ostrovskyload(
20f6ddb37SDavid Ostrovsky    "@com_googlesource_gerrit_bazlets//tools:genrule2.bzl",
30f6ddb37SDavid Ostrovsky    "genrule2",
40f6ddb37SDavid Ostrovsky)
59150caa8SDavid Pursehouseload(":tests.bzl", "tests")
60f6ddb37SDavid Ostrovsky
70f6ddb37SDavid OstrovskyPKG = "tst/org/eclipse/jgit/"
80f6ddb37SDavid Ostrovsky
9488d9557SThomas WolfHELPERS = glob(
10488d9557SThomas Wolf    ["src/**/*.java"],
11f4c0189fSDavid Pursehouse    exclude = ["src/org/eclipse/jgit/transport/ssh/*.java"],
12488d9557SThomas Wolf) + [PKG + c for c in [
130f6ddb37SDavid Ostrovsky    "api/AbstractRemoteCommandTest.java",
140f6ddb37SDavid Ostrovsky    "diff/AbstractDiffTestCase.java",
150f6ddb37SDavid Ostrovsky    "internal/storage/file/GcTestCase.java",
160f6ddb37SDavid Ostrovsky    "internal/storage/file/PackIndexTestCase.java",
170f6ddb37SDavid Ostrovsky    "internal/storage/file/XInputStream.java",
180f6ddb37SDavid Ostrovsky    "nls/GermanTranslatedBundle.java",
190f6ddb37SDavid Ostrovsky    "nls/MissingPropertyBundle.java",
200f6ddb37SDavid Ostrovsky    "nls/NoPropertiesBundle.java",
210f6ddb37SDavid Ostrovsky    "nls/NonTranslatedBundle.java",
22bab68548SJonathan Tan    "revwalk/ReachabilityCheckerTestCase.java",
230f6ddb37SDavid Ostrovsky    "revwalk/RevQueueTestCase.java",
240f6ddb37SDavid Ostrovsky    "revwalk/RevWalkTestCase.java",
25a6da0591SDavid Pursehouse    "transport/ObjectIdMatcher.java",
260f6ddb37SDavid Ostrovsky    "transport/SpiTransport.java",
270f6ddb37SDavid Ostrovsky    "treewalk/filter/AlwaysCloneTreeFilter.java",
280f6ddb37SDavid Ostrovsky    "test/resources/SampleDataRepositoryTestCase.java",
290f6ddb37SDavid Ostrovsky    "util/CPUTimeStopWatch.java",
306518d633SDavid Pursehouse    "util/http/HttpCookiesMatcher.java",
310f6ddb37SDavid Ostrovsky    "util/io/Strings.java",
320f6ddb37SDavid Ostrovsky]]
330f6ddb37SDavid Ostrovsky
340f6ddb37SDavid OstrovskyDATA = [
350f6ddb37SDavid Ostrovsky    PKG + "lib/empty.gitindex.dat",
360f6ddb37SDavid Ostrovsky    PKG + "lib/sorttest.gitindex.dat",
370f6ddb37SDavid Ostrovsky]
380f6ddb37SDavid Ostrovsky
39*cee26c00SMatthias SohnEXCLUDED = [
40*cee26c00SMatthias Sohn    PKG + "api/SecurityManagerTest.java",
41*cee26c00SMatthias Sohn]
42*cee26c00SMatthias Sohn
43488d9557SThomas WolfRESOURCES = glob(["resources/**"])
44488d9557SThomas Wolf
45bbef67e8SDavid Ostrovskytests(tests = glob(
460f6ddb37SDavid Ostrovsky    ["tst/**/*.java"],
47*cee26c00SMatthias Sohn    exclude = HELPERS + DATA + EXCLUDED,
480f6ddb37SDavid Ostrovsky))
490f6ddb37SDavid Ostrovsky
500f6ddb37SDavid Ostrovskyjava_library(
510f6ddb37SDavid Ostrovsky    name = "helpers",
520f6ddb37SDavid Ostrovsky    testonly = 1,
530f6ddb37SDavid Ostrovsky    srcs = HELPERS,
540f6ddb37SDavid Ostrovsky    resources = DATA,
550f6ddb37SDavid Ostrovsky    deps = [
5608b0a863SThomas Wolf        "//lib:jsch",
5728cfda54SDavid Pursehouse        "//lib:junit",
5806fc6c7cSMatthias Sohn        "//lib:slf4j-simple",
592532fa74SMatthias Sohn        "//lib:mockito",
600f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit:jgit",
610f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit.junit:junit",
620f6ddb37SDavid Ostrovsky    ],
630f6ddb37SDavid Ostrovsky)
640f6ddb37SDavid Ostrovsky
65488d9557SThomas Wolfjava_library(
66488d9557SThomas Wolf    name = "sshd-helpers",
67488d9557SThomas Wolf    testonly = 1,
68488d9557SThomas Wolf    srcs = glob(["src/org/eclipse/jgit/transport/ssh/*.java"]),
69488d9557SThomas Wolf    resource_strip_prefix = "org.eclipse.jgit.test/resources",
70488d9557SThomas Wolf    resources = RESOURCES,
71488d9557SThomas Wolf    visibility = [
72488d9557SThomas Wolf        "//org.eclipse.jgit.ssh.apache.test:__pkg__",
73488d9557SThomas Wolf    ],
74f4c0189fSDavid Pursehouse    deps = [
75f4c0189fSDavid Pursehouse        "//lib:jsch",
76f4c0189fSDavid Pursehouse        "//lib:junit",
7786cee68eSThomas Wolf        "//lib:sshd-osgi",
78f4c0189fSDavid Pursehouse        "//lib:sshd-sftp",
79f4c0189fSDavid Pursehouse        "//org.eclipse.jgit:jgit",
80f4c0189fSDavid Pursehouse        "//org.eclipse.jgit.junit:junit",
811316d43eSThomas Wolf        "//org.eclipse.jgit.junit.ssh:junit-ssh",
82f4c0189fSDavid Pursehouse    ],
83488d9557SThomas Wolf)
84488d9557SThomas Wolf
850f6ddb37SDavid Ostrovskyjava_import(
860f6ddb37SDavid Ostrovsky    name = "tst_rsrc",
870f6ddb37SDavid Ostrovsky    jars = [":tst_rsrc_jar"],
880f6ddb37SDavid Ostrovsky)
890f6ddb37SDavid Ostrovsky
900f6ddb37SDavid Ostrovskygenrule2(
91904e9f8bSDavid Pursehouse    name = "tst_rsrc_jar",
92904e9f8bSDavid Pursehouse    srcs = glob(["tst-rsrc/**"]),
93904e9f8bSDavid Pursehouse    outs = ["tst_rsrc.jar"],
94904e9f8bSDavid Pursehouse    cmd = "o=$$PWD/$@ && tar cf - $(SRCS) | tar -C $$TMP --strip-components=2 -xf - && cd  $$TMP && zip -qr $$o .",
950f6ddb37SDavid Ostrovsky)
96