aboutsummaryrefslogtreecommitdiff
path: root/build_defs.bzl
blob: 61858bd6351342124b050c8174c3c0237d40c07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
bouncycastle_versions = range(49, 57)

# These targets run all tests.
def bouncycastle_all_tests(srcs, deps, size, test_class):
  """BouncyCastle version-specific tests."""

  # Generates BouncyCastleAllTests_1_56, ..., BouncyCastleAllTests_1_49
  for version in bouncycastle_versions:
    native.java_test(
        name = "BouncyCastleAllTests_1_%s" % version,
        srcs = srcs,
        deps = deps + [
            "@bouncycastle_1_%s//jar" % version,
        ],
        size = size,
        test_class = test_class,
    )

  # Latest stable.
  # We can't use native.alias, because aliased tests are not run.
  # So, we simply duplicate the test.
  native.java_test(
      name = "BouncyCastleAllTests",
      srcs = srcs,
      deps = deps + ["@bouncycastle_1_%s//jar" % max(bouncycastle_versions)],
      size = size,
      test_class = test_class,
  )

# These targets exclude slow tests.
def bouncycastle_tests(srcs, deps, size, test_class):
  """BouncyCastle version-specific tests."""

  # Generates BouncyCastleTest_1_56, ..., BouncyCastleTest_1_49
  for version in bouncycastle_versions:
    native.java_test(
        name = "BouncyCastleTest_1_%s" % version,
        srcs = srcs,
        deps = deps + [
            "@bouncycastle_1_%s//jar" % version,
        ],
        size = size,
        test_class = test_class,
    )

  # Latest stable.
  # We can't use native.alias, because aliased tests are not run.
  # So, we simply duplicate the test.
  native.java_test(
      name = "BouncyCastleTest",
      srcs = srcs,
      deps = deps + ["@bouncycastle_1_%s//jar" % max(bouncycastle_versions)],
      size = size,
      test_class = test_class,
  )

spongycastle_versions = range(50, 55)

# These targets run all tests.
def spongycastle_all_tests(srcs, deps, size, test_class):
  """SpongyCastle version-specific tests."""

  # Generates SpongyCastleAllTests_1_54, ..., SpongyCastleAllTests_1_50
  for version in spongycastle_versions:
    native.java_test(
        name = "SpongyCastleAllTests_1_%s" % version,
        srcs = srcs,
        deps = deps + [
            "@spongycastle_core_1_%s//jar" % version,
            "@spongycastle_prov_1_%s//jar" % version,
        ],
        size = size,
        test_class = test_class,
    )

  # Latest stable.
  # We can't use native.alias, because aliased tests are not run.
  # So, we simply duplicate the test.
  native.java_test(
      name = "SpongyCastleAllTests",
      srcs = srcs,
      deps = deps + [
          "@spongycastle_core_1_%s//jar" % max(spongycastle_versions),
          "@spongycastle_prov_1_%s//jar" % max(spongycastle_versions),
      ],
      size = size,
      test_class = test_class,
  )

# These targets exclude slow tests.
def spongycastle_tests(srcs, deps, size, test_class):
  """SpongyCastle version-specific tests."""

  # Generates SpongyCastleTest_1_54, ..., SpongyCastleTest_1_50
  for version in spongycastle_versions:
    native.java_test(
        name = "SpongyCastleTest_1_%s" % version,
        srcs = srcs,
        deps = deps + [
            "@spongycastle_core_1_%s//jar" % version,
            "@spongycastle_prov_1_%s//jar" % version,
        ],
        size = size,
        test_class = test_class,
    )

  # Latest stable.
  # We can't use native.alias, because aliased tests are not run.
  # So, we simply duplicate the test.
  native.java_test(
      name = "SpongyCastleTest",
      srcs = srcs,
      deps = deps + [
          "@spongycastle_core_1_%s//jar" % max(spongycastle_versions),
          "@spongycastle_prov_1_%s//jar" % max(spongycastle_versions),
      ],
      size = size,
      test_class = test_class,
  )