File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
tests/run-make/rustdoc-output-stdout Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ pub struct Foo ;
Original file line number Diff line number Diff line change 1+ // This test verifies that rustdoc `-o -` prints JSON on stdout and doesn't generate
2+ // a JSON file.
3+
4+ use std:: path:: PathBuf ;
5+
6+ use run_make_support:: rustdoc;
7+ use run_make_support:: path_helpers:: { has_extension, path, read_dir_entries_recursive} ;
8+
9+ fn main ( ) {
10+ // First we check that we generate the JSON in the stdout.
11+ rustdoc ( ) . input ( "foo.rs" ) . output ( "-" ) . arg ( "-Zunstable-options" ) . output_format ( "json" ) . run ( ) . assert_stdout_contains ( "{\" " ) ;
12+
13+ // Then we check it didn't generate any JSON file.
14+ read_dir_entries_recursive ( path ( "" ) , |path| {
15+ if path. is_file ( ) && has_extension ( path, "json" ) {
16+ panic ! ( "Found a JSON file {path:?}" ) ;
17+ }
18+ } ) ;
19+ }
You can’t perform that action at this time.
0 commit comments