File tree Expand file tree Collapse file tree 5 files changed +30
-0
lines changed
tests/run-make/rustdoc-dep-info Expand file tree Collapse file tree 5 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ include ! ( "foo.rs" ) ;
Original file line number Diff line number Diff line change 1+ blablabla
Original file line number Diff line number Diff line change 1+ pub fn foo ( ) { }
Original file line number Diff line number Diff line change 1+ #![ crate_name = "foo" ]
2+
3+ #[ cfg_attr( doc, doc = include_str!( "doc.md" ) ) ]
4+ pub struct Bar ;
5+
6+ mod bar;
Original file line number Diff line number Diff line change 1+ // This is a simple smoke test for rustdoc's `--emit dep-info` feature. It prints out
2+ // information about dependencies in a Makefile-compatible format, as a `.d` file.
3+
4+ use run_make_support:: assertion_helpers:: assert_contains;
5+ use run_make_support:: { path, rfs, rustdoc} ;
6+
7+ fn main ( ) {
8+ // We're only emitting dep info, so we shouldn't be running static analysis to
9+ // figure out that this program is erroneous.
10+ rustdoc ( ) . input ( "lib.rs" ) . arg ( "-Zunstable-options" ) . emit ( "dep-info" ) . run ( ) ;
11+
12+ let content = rfs:: read_to_string ( "foo.d" ) ;
13+ assert_contains ( & content, "lib.rs:" ) ;
14+ assert_contains ( & content, "foo.rs:" ) ;
15+ assert_contains ( & content, "bar.rs:" ) ;
16+ assert_contains ( & content, "doc.md:" ) ;
17+
18+ // Now we check that we can provide a file name to the `dep-info` argument.
19+ rustdoc ( ) . input ( "lib.rs" ) . arg ( "-Zunstable-options" ) . emit ( "dep-info=bla.d" ) . run ( ) ;
20+ assert ! ( path( "bla.d" ) . exists( ) ) ;
21+ }
You can’t perform that action at this time.
0 commit comments