xref: /aosp_15_r20/external/bazelbuild-rules_testing/lib/BUILD (revision d605057434dcabba796c020773aab68d9790ff9f)
1# Copyright 2023 The Bazel Authors. 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("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16load("//lib/private:util.bzl", "do_nothing")
17
18licenses(["notice"])
19
20package(
21    default_applicable_licenses = ["//:package_license"],
22    default_visibility = ["//visibility:private"],
23)
24
25bzl_library(
26    name = "analysis_test_bzl",
27    srcs = ["analysis_test.bzl"],
28    visibility = ["//visibility:public"],
29    deps = [
30        ":test_suite_bzl",
31        ":truth_bzl",
32        "//lib/private:analysis_test_bzl",
33        "//lib/private:util_bzl",
34    ],
35)
36
37bzl_library(
38    name = "truth_bzl",
39    srcs = ["truth.bzl"],
40    visibility = ["//visibility:public"],
41    deps = [
42        "//lib/private:bool_subject_bzl",
43        "//lib/private:collection_subject_bzl",
44        "//lib/private:default_info_subject_bzl",
45        "//lib/private:depset_file_subject_bzl",
46        "//lib/private:expect_bzl",
47        "//lib/private:int_subject_bzl",
48        "//lib/private:label_subject_bzl",
49        "//lib/private:matching_bzl",
50        "//lib/private:struct_subject_bzl",
51    ],
52)
53
54bzl_library(
55    name = "util_bzl",
56    srcs = ["util.bzl"],
57    visibility = ["//visibility:public"],
58    deps = [
59        "@bazel_skylib//lib:paths",
60        "@bazel_skylib//lib:types",
61        "@bazel_skylib//lib:unittest",
62        "@bazel_skylib//rules:write_file",
63    ],
64)
65
66bzl_library(
67    name = "unit_test_bzl",
68    srcs = ["unit_test.bzl"],
69    visibility = ["//visibility:public"],
70    deps = [
71        "//lib/private:analysis_test_bzl",
72    ],
73)
74
75bzl_library(
76    name = "test_suite_bzl",
77    srcs = ["test_suite.bzl"],
78    visibility = ["//visibility:public"],
79    deps = [
80        ":unit_test_bzl",
81        "//lib/private:util_bzl",
82    ],
83)
84
85filegroup(
86    name = "test_deps",
87    testonly = True,
88    srcs = [
89        "BUILD",
90        ":analysis_test_bzl",
91        ":truth_bzl",
92        ":util_bzl",
93    ],
94    visibility = [
95        "//tools/build_defs/python/tests/base_rules:__pkg__",
96    ],
97)
98
99exports_files(
100    srcs = [
101        "analysis_test.bzl",
102        "truth.bzl",
103        "util.bzl",
104    ],
105    visibility = [
106        "//docgen:__pkg__",
107    ],
108)
109
110# Unit tests need some target because they're based upon analysis tests.
111do_nothing(
112    name = "_stub_target_for_unit_tests",
113    visibility = ["//visibility:public"],
114)
115