xref: /aosp_15_r20/external/wycheproof/BUILD (revision 3d322d526be0ef039eebde10aa6ae75db8cc3a3d)
1*3d322d52SAndroid Build Coastguard Worker# Wycheproof tests
2*3d322d52SAndroid Build Coastguard Worker
3*3d322d52SAndroid Build Coastguard Workerjava_library(
4*3d322d52SAndroid Build Coastguard Worker    name = "utils",
5*3d322d52SAndroid Build Coastguard Worker    srcs = [
6*3d322d52SAndroid Build Coastguard Worker        "java/com/google/security/wycheproof/EcUtil.java",
7*3d322d52SAndroid Build Coastguard Worker        "java/com/google/security/wycheproof/RandomUtil.java",
8*3d322d52SAndroid Build Coastguard Worker        "java/com/google/security/wycheproof/TestUtil.java",
9*3d322d52SAndroid Build Coastguard Worker    ],
10*3d322d52SAndroid Build Coastguard Worker)
11*3d322d52SAndroid Build Coastguard Worker
12*3d322d52SAndroid Build Coastguard Workercommon_deps = [
13*3d322d52SAndroid Build Coastguard Worker    ":utils",
14*3d322d52SAndroid Build Coastguard Worker]
15*3d322d52SAndroid Build Coastguard Worker
16*3d322d52SAndroid Build Coastguard Workertest_srcs = glob(["java/com/google/security/wycheproof/testcases/*.java"]) + ["java/com/google/security/wycheproof/WycheproofRunner.java"]
17*3d322d52SAndroid Build Coastguard Worker
18*3d322d52SAndroid Build Coastguard Worker# These targets run all tests.
19*3d322d52SAndroid Build Coastguard Worker
20*3d322d52SAndroid Build Coastguard Workerload(":build_defs.bzl", "bouncycastle_all_tests", "spongycastle_all_tests")
21*3d322d52SAndroid Build Coastguard Worker
22*3d322d52SAndroid Build Coastguard Worker# Generates BouncyCastleAllTests_1_xx target for all available versions,
23*3d322d52SAndroid Build Coastguard Worker# plus a BouncyCastleAllTests alias for latest stable.
24*3d322d52SAndroid Build Coastguard Worker#
25*3d322d52SAndroid Build Coastguard Worker# To test latest stable:
26*3d322d52SAndroid Build Coastguard Worker# $ bazel test BouncyCastleAllTests
27*3d322d52SAndroid Build Coastguard Worker#
28*3d322d52SAndroid Build Coastguard Worker# To test other versions, e.g., v1.52:
29*3d322d52SAndroid Build Coastguard Worker# $ bazel test BouncyCastleAllTests_1_52
30*3d322d52SAndroid Build Coastguard Worker#
31*3d322d52SAndroid Build Coastguard Worker# To test all known versions (warning, will take a long time):
32*3d322d52SAndroid Build Coastguard Worker# $ bazel test BouncyCastleAllTest_*
33*3d322d52SAndroid Build Coastguard Workerbouncycastle_all_tests(
34*3d322d52SAndroid Build Coastguard Worker    # This test takes a long time, because key generation for DSA and DH generate new parameters.
35*3d322d52SAndroid Build Coastguard Worker    size = "large",
36*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/BouncyCastleAllTests.java"] + test_srcs,
37*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.BouncyCastleAllTests",
38*3d322d52SAndroid Build Coastguard Worker    deps = common_deps,
39*3d322d52SAndroid Build Coastguard Worker)
40*3d322d52SAndroid Build Coastguard Worker
41*3d322d52SAndroid Build Coastguard Workerjava_test(
42*3d322d52SAndroid Build Coastguard Worker    name = "BouncyCastleAllTestsLocal",
43*3d322d52SAndroid Build Coastguard Worker    # this target requires specifing a shell variable, thus won't work with the wildcard target patterns.
44*3d322d52SAndroid Build Coastguard Worker    # with tags=["manual"] it'll be excluded from said patterns.
45*3d322d52SAndroid Build Coastguard Worker    tags = ["manual"],
46*3d322d52SAndroid Build Coastguard Worker    size = "large",
47*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/BouncyCastleAllTests.java"] + test_srcs,
48*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.BouncyCastleAllTests",
49*3d322d52SAndroid Build Coastguard Worker    deps = common_deps + ["@local//:bouncycastle_jar"],
50*3d322d52SAndroid Build Coastguard Worker)
51*3d322d52SAndroid Build Coastguard Worker
52*3d322d52SAndroid Build Coastguard Worker# Generates SpongyCastleAllTests_1_xx target for all available versions,
53*3d322d52SAndroid Build Coastguard Worker# plus a SpongyCastleAllTests alias for latest stable.
54*3d322d52SAndroid Build Coastguard Worker#
55*3d322d52SAndroid Build Coastguard Worker# To test latest stable:
56*3d322d52SAndroid Build Coastguard Worker# $ bazel test SpongyCastleAllTests
57*3d322d52SAndroid Build Coastguard Worker#
58*3d322d52SAndroid Build Coastguard Worker# To test other versions, e.g., v1.52.0.0:
59*3d322d52SAndroid Build Coastguard Worker# $ bazel test SpongyCastleAllTests_1_52
60*3d322d52SAndroid Build Coastguard Worker#
61*3d322d52SAndroid Build Coastguard Worker# To test all known versions (warning, will take a long time):
62*3d322d52SAndroid Build Coastguard Worker# $ bazel test SpongyCastleAllTests_*
63*3d322d52SAndroid Build Coastguard Workerspongycastle_all_tests(
64*3d322d52SAndroid Build Coastguard Worker    # This test takes a long time, because key generation for DSA and DH generate new parameters.
65*3d322d52SAndroid Build Coastguard Worker    size = "large",
66*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/SpongyCastleAllTests.java"] + test_srcs,
67*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.SpongyCastleAllTests",
68*3d322d52SAndroid Build Coastguard Worker    deps = common_deps,
69*3d322d52SAndroid Build Coastguard Worker)
70*3d322d52SAndroid Build Coastguard Worker
71*3d322d52SAndroid Build Coastguard Worker# These targets exclude slow tests.
72*3d322d52SAndroid Build Coastguard Worker
73*3d322d52SAndroid Build Coastguard Workerload(":build_defs.bzl", "bouncycastle_tests", "spongycastle_tests")
74*3d322d52SAndroid Build Coastguard Worker
75*3d322d52SAndroid Build Coastguard Worker# Generates BouncyCastleTest_1_xx target for all available versions,
76*3d322d52SAndroid Build Coastguard Worker# plus a BouncyCastleTest alias for latest stable.
77*3d322d52SAndroid Build Coastguard Worker#
78*3d322d52SAndroid Build Coastguard Worker# To test latest stable:
79*3d322d52SAndroid Build Coastguard Worker# $ bazel test BouncyCastleTest
80*3d322d52SAndroid Build Coastguard Worker#
81*3d322d52SAndroid Build Coastguard Worker# To test other versions, e.g., v1.52:
82*3d322d52SAndroid Build Coastguard Worker# $ bazel test BouncyCastleTest_1_52
83*3d322d52SAndroid Build Coastguard Worker#
84*3d322d52SAndroid Build Coastguard Worker# To test all known versions:
85*3d322d52SAndroid Build Coastguard Worker# $ bazel test BouncyCastleTest_*
86*3d322d52SAndroid Build Coastguard Workerbouncycastle_tests(
87*3d322d52SAndroid Build Coastguard Worker    size = "large",
88*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/BouncyCastleTest.java"] + test_srcs,
89*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.BouncyCastleTest",
90*3d322d52SAndroid Build Coastguard Worker    deps = common_deps,
91*3d322d52SAndroid Build Coastguard Worker)
92*3d322d52SAndroid Build Coastguard Worker
93*3d322d52SAndroid Build Coastguard Workerjava_test(
94*3d322d52SAndroid Build Coastguard Worker    name = "BouncyCastleTestLocal",
95*3d322d52SAndroid Build Coastguard Worker    # this target requires specifing a shell variable, thus won't work with the wildcard target patterns.
96*3d322d52SAndroid Build Coastguard Worker    # with tags=["manual"] it'll be excluded from said patterns.
97*3d322d52SAndroid Build Coastguard Worker    tags = ["manual"],
98*3d322d52SAndroid Build Coastguard Worker    size = "large",
99*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/BouncyCastleTest.java"] + test_srcs,
100*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.BouncyCastleTest",
101*3d322d52SAndroid Build Coastguard Worker    deps = common_deps + ["@local//:bouncycastle_jar"],
102*3d322d52SAndroid Build Coastguard Worker)
103*3d322d52SAndroid Build Coastguard Worker
104*3d322d52SAndroid Build Coastguard Worker# Generates SpongyCastleTest_1_xx target for all available versions,
105*3d322d52SAndroid Build Coastguard Worker# plus a SpongyCastleTest alias for latest stable.
106*3d322d52SAndroid Build Coastguard Worker#
107*3d322d52SAndroid Build Coastguard Worker# To test latest stable:
108*3d322d52SAndroid Build Coastguard Worker# $ bazel test SpongyCastleTest
109*3d322d52SAndroid Build Coastguard Worker#
110*3d322d52SAndroid Build Coastguard Worker# To test other versions, e.g., v1.52.0.0:
111*3d322d52SAndroid Build Coastguard Worker# $ bazel test SpongyCastleTest_1_52
112*3d322d52SAndroid Build Coastguard Worker#
113*3d322d52SAndroid Build Coastguard Worker# To test all known versions:
114*3d322d52SAndroid Build Coastguard Worker# $ bazel test SpongyCastleTest_*
115*3d322d52SAndroid Build Coastguard Workerspongycastle_tests(
116*3d322d52SAndroid Build Coastguard Worker    size = "large",
117*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/SpongyCastleTest.java"] + test_srcs,
118*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.SpongyCastleTest",
119*3d322d52SAndroid Build Coastguard Worker    deps = common_deps,
120*3d322d52SAndroid Build Coastguard Worker)
121*3d322d52SAndroid Build Coastguard Worker
122*3d322d52SAndroid Build Coastguard Worker# OpenJDK tests
123*3d322d52SAndroid Build Coastguard Workerjava_test(
124*3d322d52SAndroid Build Coastguard Worker    name = "OpenJDKTest",
125*3d322d52SAndroid Build Coastguard Worker    size = "large",
126*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/OpenJDKTest.java"] + test_srcs,
127*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.OpenJDKTest",
128*3d322d52SAndroid Build Coastguard Worker    deps = common_deps,
129*3d322d52SAndroid Build Coastguard Worker)
130*3d322d52SAndroid Build Coastguard Worker
131*3d322d52SAndroid Build Coastguard Workerjava_test(
132*3d322d52SAndroid Build Coastguard Worker    name = "OpenJDKAllTests",
133*3d322d52SAndroid Build Coastguard Worker    size = "large",
134*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/OpenJDKAllTests.java"] + test_srcs,
135*3d322d52SAndroid Build Coastguard Worker    test_class = "com.google.security.wycheproof.OpenJDKAllTests",
136*3d322d52SAndroid Build Coastguard Worker    deps = common_deps,
137*3d322d52SAndroid Build Coastguard Worker)
138*3d322d52SAndroid Build Coastguard Worker
139*3d322d52SAndroid Build Coastguard Worker# Platform-independent tests
140*3d322d52SAndroid Build Coastguard Workerjava_test(
141*3d322d52SAndroid Build Coastguard Worker    name = "ProviderIndependentTest",
142*3d322d52SAndroid Build Coastguard Worker    size = "small",
143*3d322d52SAndroid Build Coastguard Worker    srcs = ["java/com/google/security/wycheproof/ProviderIndependentTest.java"] + test_srcs,
144*3d322d52SAndroid Build Coastguard Worker    deps = common_deps,
145*3d322d52SAndroid Build Coastguard Worker)
146