You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tests.bzl 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. load(
  2. "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
  3. "junit_tests",
  4. )
  5. def tests(tests):
  6. for src in tests:
  7. name = src[len("tst/"):len(src) - len(".java")].replace("/", "_")
  8. labels = []
  9. if name.startswith("org_eclipse_jgit_"):
  10. l = name[len("org.eclipse.jgit_"):]
  11. if l.startswith("internal_storage_"):
  12. l = l[len("internal.storage_"):]
  13. i = l.find("_")
  14. if i > 0:
  15. labels.append(l[:i])
  16. else:
  17. labels.append(i)
  18. if "lib" not in labels:
  19. labels.append("lib")
  20. additional_deps = []
  21. if src.endswith("RootLocaleTest.java"):
  22. additional_deps = [
  23. "//org.eclipse.jgit.pgm:pgm",
  24. "//org.eclipse.jgit.ui:ui",
  25. ]
  26. if src.endswith("WalkEncryptionTest.java"):
  27. additional_deps = [
  28. "//org.eclipse.jgit:insecure_cipher_factory",
  29. ]
  30. if src.endswith("OpenSshConfigTest.java"):
  31. additional_deps = [
  32. "//lib:jsch",
  33. ]
  34. if src.endswith("JschConfigSessionFactoryTest.java"):
  35. additional_deps = [
  36. "//lib:jsch",
  37. ]
  38. junit_tests(
  39. name = name,
  40. tags = labels,
  41. srcs = [src],
  42. deps = additional_deps + [
  43. ":helpers",
  44. ":tst_rsrc",
  45. "//lib:javaewah",
  46. "//lib:junit",
  47. "//lib:slf4j-api",
  48. "//org.eclipse.jgit:jgit",
  49. "//org.eclipse.jgit.junit:junit",
  50. "//org.eclipse.jgit.lfs:jgit-lfs",
  51. ],
  52. jvm_flags = ["-Xmx256m", "-Dfile.encoding=UTF-8"],
  53. )