@@ -129,6 +129,11 @@ pub struct TestProps {
129
129
pub check_stdout : bool ,
130
130
// Check stdout & stderr for output of run-pass test
131
131
pub check_run_results : bool ,
132
+ /// Check that stdout from running the binary is legal JSON Lines
133
+ /// (i.e. each line is well-formed JSON).
134
+ ///
135
+ /// Has no effect in tests that don't run the compiled binary.
136
+ pub check_run_stdout_is_json_lines : bool ,
132
137
// For UI tests, allows compiler to generate arbitrary output to stdout
133
138
pub dont_check_compiler_stdout : bool ,
134
139
// For UI tests, allows compiler to generate arbitrary output to stderr
@@ -226,6 +231,7 @@ mod directives {
226
231
pub const FORCE_HOST : & ' static str = "force-host" ;
227
232
pub const CHECK_STDOUT : & ' static str = "check-stdout" ;
228
233
pub const CHECK_RUN_RESULTS : & ' static str = "check-run-results" ;
234
+ pub const CHECK_RUN_STDOUT_IS_JSON_LINES : & ' static str = "check-run-stdout-is-json-lines" ;
229
235
pub const DONT_CHECK_COMPILER_STDOUT : & ' static str = "dont-check-compiler-stdout" ;
230
236
pub const DONT_CHECK_COMPILER_STDERR : & ' static str = "dont-check-compiler-stderr" ;
231
237
pub const NO_PREFER_DYNAMIC : & ' static str = "no-prefer-dynamic" ;
@@ -285,6 +291,7 @@ impl TestProps {
285
291
force_host : false ,
286
292
check_stdout : false ,
287
293
check_run_results : false ,
294
+ check_run_stdout_is_json_lines : false ,
288
295
dont_check_compiler_stdout : false ,
289
296
dont_check_compiler_stderr : false ,
290
297
compare_output_lines_by_subset : false ,
@@ -423,6 +430,11 @@ impl TestProps {
423
430
DONT_CHECK_COMPILER_STDOUT ,
424
431
& mut self . dont_check_compiler_stdout ,
425
432
) ;
433
+ config. set_name_directive (
434
+ ln,
435
+ CHECK_RUN_STDOUT_IS_JSON_LINES ,
436
+ & mut self . check_run_stdout_is_json_lines ,
437
+ ) ;
426
438
config. set_name_directive (
427
439
ln,
428
440
DONT_CHECK_COMPILER_STDERR ,
@@ -739,6 +751,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
739
751
"check-fail" ,
740
752
"check-pass" ,
741
753
"check-run-results" ,
754
+ "check-run-stdout-is-json-lines" ,
742
755
"check-stdout" ,
743
756
"check-test-line-numbers-match" ,
744
757
"compare-output-lines-by-subset" ,
0 commit comments