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/jvm/testing:for_analysis.bzl", ktfa = "kt_for_analysis") 16load("//kotlin/jvm/testing:jvm_library_analysis_test.bzl", "kt_jvm_library_analysis_test") 17 18package( 19 default_applicable_licenses = ["//:license"], 20 default_testonly = True, 21 default_visibility = ["//tests/jvm/analysis/jvm_library/friends:__subpackages__"], 22) 23 24licenses(["notice"]) 25 26kt_jvm_library_analysis_test( 27 name = "has_kt_exported_friend_impl_package_test", 28 expected_friend_jar_names = [ 29 "libkt_exports_friend-compile.jar", 30 "libfriend-compile.jar", 31 ], 32 target_under_test = ktfa.kt_jvm_library( 33 name = "has_kt_exported_friend_impl_package", 34 srcs = ["Input.kt"], 35 deps = [":kt_exports_friend"], 36 ), 37) 38 39kt_jvm_library_analysis_test( 40 name = "has_direct_friend_impl_package_test", 41 expected_friend_jar_names = [ 42 "libfriend-compile.jar", 43 ], 44 target_under_test = ktfa.kt_jvm_library( 45 name = "has_direct_friend_impl_package", 46 srcs = ["Input.kt"], 47 deps = ["//tests/jvm/analysis/jvm_library/friends:friend"], 48 ), 49) 50 51kt_jvm_library_analysis_test( 52 name = "no_kt_exported_friend_sibling_package_test", 53 expected_friend_jar_names = [ 54 "libkt_exports_subfriend-compile.jar", 55 # Absent # "subfriend-compile.jar" 56 ], 57 target_under_test = ktfa.kt_jvm_library( 58 name = "no_kt_exported_friend_sibling_package", 59 srcs = ["Input.kt"], 60 deps = [":kt_exports_subfriend"], 61 ), 62) 63 64kt_jvm_library_analysis_test( 65 name = "no_direct_friend_sibling_package_test", 66 expected_friend_jar_names = [], 67 target_under_test = ktfa.kt_jvm_library( 68 name = "no_direct_friend_sibling_package", 69 srcs = ["Input.kt"], 70 deps = ["//tests/jvm/analysis/jvm_library/friends/sub:subfriend"], 71 ), 72) 73 74ktfa.kt_jvm_library( 75 name = "kt_exports_subfriend", 76 srcs = ["Input.kt"], 77 exports = ["//tests/jvm/analysis/jvm_library/friends/sub:subfriend"], 78) 79 80ktfa.kt_jvm_library( 81 name = "kt_exports_friend", 82 srcs = ["Input.kt"], 83 exports = ["//tests/jvm/analysis/jvm_library/friends:friend"], 84) 85 86ktfa.kt_jvm_library( 87 name = "testingfriend", 88 srcs = ["Input.kt"], 89) 90