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.

BUCK 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. PKG = 'tst/org/eclipse/jgit/'
  2. HELPERS = glob(['src/**/*.java']) + [PKG + c for c in [
  3. 'api/AbstractRemoteCommandTest.java',
  4. 'diff/AbstractDiffTestCase.java',
  5. 'internal/storage/file/GcTestCase.java',
  6. 'internal/storage/file/PackIndexTestCase.java',
  7. 'internal/storage/file/XInputStream.java',
  8. 'nls/GermanTranslatedBundle.java',
  9. 'nls/MissingPropertyBundle.java',
  10. 'nls/NoPropertiesBundle.java',
  11. 'nls/NonTranslatedBundle.java',
  12. 'revwalk/RevQueueTestCase.java',
  13. 'revwalk/RevWalkTestCase.java',
  14. 'transport/SpiTransport.java',
  15. 'treewalk/FileTreeIteratorWithTimeControl.java',
  16. 'treewalk/filter/AlwaysCloneTreeFilter.java',
  17. 'test/resources/SampleDataRepositoryTestCase.java',
  18. 'util/CPUTimeStopWatch.java',
  19. 'util/io/Strings.java',
  20. ]]
  21. DATA = [
  22. PKG + 'lib/empty.gitindex.dat',
  23. PKG + 'lib/sorttest.gitindex.dat',
  24. ]
  25. TESTS = glob(
  26. ['tst/**/*.java'],
  27. excludes = HELPERS + DATA,
  28. )
  29. DEPS = {
  30. PKG + 'nls/RootLocaleTest.java': [
  31. '//org.eclipse.jgit.pgm:pgm',
  32. '//org.eclipse.jgit.ui:ui',
  33. ],
  34. }
  35. for src in TESTS:
  36. name = src[len('tst/'):len(src)-len('.java')].replace('/', '.')
  37. labels = []
  38. if name.startswith('org.eclipse.jgit.'):
  39. l = name[len('org.eclipse.jgit.'):]
  40. if l.startswith('internal.storage.'):
  41. l = l[len('internal.storage.'):]
  42. i = l.find('.')
  43. if i > 0:
  44. labels.append(l[:i])
  45. else:
  46. labels.append(i)
  47. if 'lib' not in labels:
  48. labels.append('lib')
  49. java_test(
  50. name = name,
  51. labels = labels,
  52. srcs = [src],
  53. deps = [
  54. ':helpers',
  55. ':tst_rsrc',
  56. '//org.eclipse.jgit:jgit',
  57. '//org.eclipse.jgit.junit:junit',
  58. '//lib:hamcrest-core',
  59. '//lib:hamcrest-library',
  60. '//lib:javaewah',
  61. '//lib:junit',
  62. '//lib:slf4j-api',
  63. '//lib:slf4j-simple',
  64. ] + DEPS.get(src, []),
  65. source_under_test = ['//org.eclipse.jgit:jgit'],
  66. vm_args = ['-Xmx256m', '-Dfile.encoding=UTF-8'],
  67. )
  68. java_library(
  69. name = 'helpers',
  70. srcs = HELPERS,
  71. resources = DATA,
  72. deps = [
  73. '//org.eclipse.jgit:jgit',
  74. '//org.eclipse.jgit.junit:junit',
  75. '//lib:junit',
  76. ],
  77. )
  78. prebuilt_jar(
  79. name = 'tst_rsrc',
  80. binary_jar = ':tst_rsrc_jar',
  81. )
  82. genrule(
  83. name = 'tst_rsrc_jar',
  84. cmd = 'cd $SRCDIR/tst-rsrc ; zip -qr $OUT .',
  85. srcs = glob(['tst-rsrc/**']),
  86. out = 'tst_rsrc.jar',
  87. )