Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

tests.bzl 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. junit_tests(
  35. name = name,
  36. tags = labels,
  37. srcs = [src],
  38. deps = additional_deps + [
  39. ':helpers',
  40. ':tst_rsrc',
  41. '//lib:javaewah',
  42. '//lib:junit',
  43. '//lib:slf4j-api',
  44. '//org.eclipse.jgit:jgit',
  45. '//org.eclipse.jgit.junit:junit',
  46. '//org.eclipse.jgit.lfs:jgit-lfs',
  47. ],
  48. jvm_flags = ["-Xmx256m", "-Dfile.encoding=UTF-8"],
  49. )