aboutsummaryrefslogtreecommitdiff
path: root/test/BUILD
blob: c97b5a4bba86a35c6cef2cc2898f35bf65e0a9f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
load(":stardoc_test.bzl", "stardoc_test")

licenses(["notice"])  # Apache 2.0

sh_test(
    name = "stardoc_self_gen_test",
    srcs = ["diff_test_runner.sh"],
    args = [
        "$(location //stardoc:stardoc_doc.md)",
        "$(location //:stardoc_rule_doc)",
    ],
    data = [
        "//:stardoc_rule_doc",
        "//stardoc:stardoc_doc.md",
    ],
)

exports_files(["testdata/fakedeps/dep.bzl"])

stardoc_test(
    name = "input_template_test",
    aspect_template = "testdata/input_template_test/aspect.vm",
    func_template = "testdata/input_template_test/func.vm",
    golden_file = "testdata/input_template_test/golden.md",
    header_template = "testdata/input_template_test/header.vm",
    input_file = "testdata/input_template_test/input.bzl",
    provider_template = "testdata/input_template_test/provider.vm",
    rule_template = "testdata/input_template_test/rule.vm",
)

stardoc_test(
    name = "angle_bracket_test",
    golden_file = "testdata/angle_bracket_test/golden.md",
    input_file = "testdata/angle_bracket_test/input.bzl",
)

stardoc_test(
    name = "proto_format_test",
    format = "proto",
    golden_file = "testdata/proto_format_test/golden.raw",
    input_file = "testdata/proto_format_test/input.bzl",
)

stardoc_test(
    name = "cc_api_test",
    golden_file = "testdata/cc_api_test/golden.md",
    input_file = "testdata/cc_api_test/input.bzl",
)

stardoc_test(
    name = "simple_test",
    golden_file = "testdata/simple_test/golden.md",
    input_file = "testdata/simple_test/input.bzl",
    symbol_names = ["my_rule"],
)

stardoc_test(
    name = "repo_rules_test",
    golden_file = "testdata/repo_rules_test/golden.md",
    input_file = "testdata/repo_rules_test/input.bzl",
)

stardoc_test(
    name = "unknown_name_test",
    golden_file = "testdata/unknown_name_test/golden.md",
    input_file = "testdata/unknown_name_test/input.bzl",
)

stardoc_test(
    name = "multiple_rules_test",
    golden_file = "testdata/multiple_rules_test/golden.md",
    input_file = "testdata/multiple_rules_test/input.bzl",
)

stardoc_test(
    name = "android_basic_test",
    golden_file = "testdata/android_basic_test/golden.md",
    input_file = "testdata/android_basic_test/input.bzl",
    semantic_flags = [
        "--experimental_google_legacy_api",
    ],
    symbol_names = ["android_related_rule"],
)

stardoc_test(
    name = "apple_basic_test",
    golden_file = "testdata/apple_basic_test/golden.md",
    input_file = "testdata/apple_basic_test/input.bzl",
    symbol_names = ["apple_related_rule"],
)

stardoc_test(
    name = "cpp_basic_test",
    golden_file = "testdata/cpp_basic_test/golden.md",
    input_file = "testdata/cpp_basic_test/input.bzl",
    symbol_names = ["cpp_related_rule"],
)

stardoc_test(
    name = "java_basic_test",
    golden_file = "testdata/java_basic_test/golden.md",
    input_file = "testdata/java_basic_test/input.bzl",
    symbol_names = ["java_related_rule"],
)

stardoc_test(
    name = "multiple_files_test",
    golden_file = "testdata/multiple_files_test/golden.md",
    input_file = "testdata/multiple_files_test/input.bzl",
    deps = [
        "testdata/multiple_files_test/dep.bzl",
        "testdata/multiple_files_test/inner_dep.bzl",
    ],
)

stardoc_test(
    name = "same_level_file_test",
    golden_file = "//test/testdata/same_level_file_test:golden.md",
    input_file = "//test/testdata/same_level_file_test:input.bzl",
    symbol_names = ["my_rule"],
    deps = [
        "//test/testdata/same_level_file_test:dep.bzl",
    ],
)

stardoc_test(
    name = "misc_apis_test",
    golden_file = "testdata/misc_apis_test/golden.md",
    input_file = "testdata/misc_apis_test/input.bzl",
)

stardoc_test(
    name = "attribute_types_test",
    golden_file = "testdata/attribute_types_test/golden.md",
    input_file = "testdata/attribute_types_test/input.bzl",
    symbol_names = ["my_rule"],
)

stardoc_test(
    name = "filter_rules_test",
    golden_file = "testdata/filter_rules_test/golden.md",
    input_file = "testdata/filter_rules_test/input.bzl",
    symbol_names = [
        "my_rule",
        "whitelisted_dep_rule",
    ],
    deps = [
        "testdata/filter_rules_test/dep.bzl",
    ],
)

stardoc_test(
    name = "provider_basic_test",
    golden_file = "testdata/provider_basic_test/golden.md",
    input_file = "testdata/provider_basic_test/input.bzl",
)

stardoc_test(
    name = "function_basic_test",
    golden_file = "testdata/function_basic_test/golden.md",
    input_file = "testdata/function_basic_test/input.bzl",
)

stardoc_test(
    name = "namespace_test",
    golden_file = "testdata/namespace_test/golden.md",
    input_file = "testdata/namespace_test/input.bzl",
)

stardoc_test(
    name = "namespace_test_with_whitelist",
    golden_file = "testdata/namespace_test/golden.md",
    input_file = "testdata/namespace_test/input.bzl",
    symbol_names = [
        "my_namespace",
    ],
)

stardoc_test(
    name = "multi_level_namespace_test",
    golden_file = "testdata/multi_level_namespace_test/golden.md",
    input_file = "testdata/multi_level_namespace_test/input.bzl",
)

stardoc_test(
    name = "multi_level_namespace_test_with_whitelist",
    golden_file = "testdata/multi_level_namespace_test_with_whitelist/golden.md",
    input_file = "testdata/multi_level_namespace_test_with_whitelist/input.bzl",
    symbol_names = [
        "my_namespace",
        "other_namespace.foo.nothing",
    ],
)

stardoc_test(
    name = "macro_kwargs_test",
    golden_file = "testdata/macro_kwargs_test/golden.md",
    input_file = "testdata/macro_kwargs_test/input.bzl",
)

stardoc_test(
    name = "py_rule_test",
    golden_file = "testdata/py_rule_test/golden.md",
    input_file = "testdata/py_rule_test/input.bzl",
    symbol_names = ["py_related_rule"],
)

stardoc_test(
    name = "struct_default_value_test",
    golden_file = "testdata/struct_default_value_test/golden.md",
    input_file = "testdata/struct_default_value_test/input.bzl",
)

stardoc_test(
    name = "aspect_test",
    golden_file = "testdata/aspect_test/golden.md",
    input_file = "testdata/aspect_test/input.bzl",
)

stardoc_test(
    name = "providers_for_attributes_test",
    golden_file = "testdata/providers_for_attributes_test/golden.md",
    input_file = "testdata/providers_for_attributes_test/input.bzl",
    deps = [
        "testdata/providers_for_attributes_test/dep.bzl",
    ],
)

stardoc_test(
    name = "html_tables_template_test",
    golden_file = "testdata/html_tables_template_test/golden.md",
    input_file = "testdata/html_tables_template_test/input.bzl",
    test = "html_tables",
)

stardoc_test(
    name = "attribute_defaults_test",
    golden_file = "testdata/attribute_defaults_test/golden.md",
    input_file = "testdata/attribute_defaults_test/input.bzl",
)

stardoc_test(
    name = "config_apis_test",
    golden_file = "testdata/config_apis_test/golden.md",
    input_file = "testdata/config_apis_test/input.bzl",
)

genrule(
    name = "generate_bzl_test_dep",
    srcs = ["testdata/generated_bzl_test/dep.bzl.tpl"],
    outs = ["testdata/generated_bzl_test/dep.bzl"],
    cmd = "cp $< $@",
)

stardoc_test(
    name = "generated_bzl_test",
    golden_file = "testdata/generated_bzl_test/golden.md",
    input_file = "testdata/generated_bzl_test/input.bzl",
    deps = [
        "testdata/generated_bzl_test/dep.bzl",
    ],
)

sh_test(
    name = "local_repository_test_e2e_test",
    srcs = ["diff_test_runner.sh"],
    args = [
        "$(location @local_repository_test//:output.md)",
        "$(location @local_repository_test//:golden.md)",
    ],
    data = [
        "@local_repository_test//:golden.md",
        "@local_repository_test//:output.md",
    ],
)