Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

tests.bzl 1.2KB

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