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(default_testonly = 1) 18 19licenses(["notice"]) 20 21kt_jvm_library( 22 name = "junit", 23 srcs = glob(["*.kt"]), 24 deps = [ 25 "@maven//:com_google_truth_truth", 26 "@maven//:junit_junit", 27 ], 28) 29 30# test_class inferred from test name (srcs irrelevant) 31kt_jvm_test( 32 name = "FooTest", 33 srcs = ["FooTest.kt"], 34 tags = ["darwin_x86_64_compatible"], 35 deps = [ 36 "@maven//:com_google_truth_truth", 37 "@maven//:junit_junit", 38 ], 39) 40 41kt_jvm_test( 42 name = "FooTest_separate", 43 tags = ["darwin_x86_64_compatible"], 44 test_class = "junit.FooTest", 45 runtime_deps = [":junit"], 46) 47 48# test_class inferred from test name (srcs not needed) 49kt_jvm_test( 50 name = "BarTest", 51 tags = ["darwin_x86_64_compatible"], 52 runtime_deps = [":junit"], 53) 54 55java_test( 56 name = "SampleTest", 57 tags = ["darwin_x86_64_compatible"], 58 runtime_deps = [":junit"], 59) 60