@@ -111,6 +111,18 @@ def _rustdoc_zip_output_test_impl(ctx):
111
111
112
112
return analysistest .end (env )
113
113
114
+ def _rustdoc_with_json_error_format_test_impl (ctx ):
115
+ env = analysistest .begin (ctx )
116
+ tut = analysistest .target_under_test (env )
117
+
118
+ _common_rustdoc_checks (env , tut )
119
+
120
+ action = _get_rustdoc_action (env , tut )
121
+
122
+ assert_argv_contains (env , action , "--error-format=json" )
123
+
124
+ return analysistest .end (env )
125
+
114
126
rustdoc_for_lib_test = analysistest .make (_rustdoc_for_lib_test_impl )
115
127
rustdoc_for_bin_test = analysistest .make (_rustdoc_for_bin_test_impl )
116
128
rustdoc_for_proc_macro_test = analysistest .make (_rustdoc_for_proc_macro_test_impl )
@@ -119,6 +131,9 @@ rustdoc_for_bin_with_transitive_proc_macro_test = analysistest.make(_rustdoc_for
119
131
rustdoc_for_lib_with_cc_lib_test = analysistest .make (_rustdoc_for_lib_with_cc_lib_test_impl )
120
132
rustdoc_with_args_test = analysistest .make (_rustdoc_with_args_test_impl )
121
133
rustdoc_zip_output_test = analysistest .make (_rustdoc_zip_output_test_impl )
134
+ rustdoc_with_json_error_format_test = analysistest .make (_rustdoc_with_json_error_format_test_impl , config_settings = {
135
+ "@//:error_format" : "json" ,
136
+ })
122
137
123
138
def _target_maker (rule_fn , name , rustdoc_deps = [], ** kwargs ):
124
139
rule_fn (
@@ -321,6 +336,11 @@ def rustdoc_test_suite(name):
321
336
target_under_test = ":rustdoc_with_args" ,
322
337
)
323
338
339
+ rustdoc_with_json_error_format_test (
340
+ name = "rustdoc_with_json_error_format_test" ,
341
+ target_under_test = ":lib_doc" ,
342
+ )
343
+
324
344
native .filegroup (
325
345
name = "lib_doc_zip" ,
326
346
srcs = [":lib_doc.zip" ],
@@ -340,6 +360,7 @@ def rustdoc_test_suite(name):
340
360
":rustdoc_for_lib_with_proc_macro_test" ,
341
361
":rustdoc_for_lib_with_cc_lib_test" ,
342
362
":rustdoc_with_args_test" ,
363
+ ":rustdoc_with_json_error_format_test" ,
343
364
":rustdoc_zip_output_test" ,
344
365
],
345
366
)
0 commit comments