xref: /aosp_15_r20/external/bazelbuild-kotlin-rules/tests/jvm/java/junit/BUILD (revision 3a22c0a33dd99bcca39a024d43e6fbcc55c2806e)
1# Copyright 2022 Google LLC. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the License);
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load("//kotlin:rules.bzl", "kt_jvm_library", "kt_jvm_test")
16
17package(
18    default_testonly = 1,
19)
20
21licenses(["notice"])
22
23kt_jvm_library(
24    name = "junit",
25    srcs = glob(["*.kt"]),
26    deps = [
27        "@maven//:com_google_truth_truth",
28        "@maven//:junit_junit",
29    ],
30)
31
32# test_class inferred from test name (srcs irrelevant)
33kt_jvm_test(
34    name = "FooTest",
35    srcs = ["FooTest.kt"],
36    tags = ["darwin_x86_64_compatible"],
37    deps = [
38        "@maven//:com_google_truth_truth",
39        "@maven//:junit_junit",
40    ],
41)
42
43kt_jvm_test(
44    name = "FooTest_separate",
45    tags = ["darwin_x86_64_compatible"],
46    test_class = "junit.FooTest",
47    runtime_deps = [":junit"],
48)
49
50# test_class inferred from test name (srcs not needed)
51kt_jvm_test(
52    name = "BarTest",
53    tags = ["darwin_x86_64_compatible"],
54    runtime_deps = [":junit"],
55)
56
57java_test(
58    name = "SampleTest",
59    tags = ["darwin_x86_64_compatible"],
60    runtime_deps = [":junit"],
61)
62