5 files changed +31
-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:: path;
5
+ use run_make_support:: assertion_helpers:: assert_contains;
6
+ use run_make_support:: { rfs, rustdoc} ;
7
+
8
+ fn main ( ) {
9
+ // We're only emitting dep info, so we shouldn't be running static analysis to
10
+ // figure out that this program is erroneous.
11
+ rustdoc ( ) . input ( "lib.rs" ) . arg ( "-Zunstable-options" ) . emit ( "dep-info" ) . run ( ) ;
12
+
13
+ let content = rfs:: read_to_string ( "foo.d" ) ;
14
+ assert_contains ( & content, "lib.rs:" ) ;
15
+ assert_contains ( & content, "foo.rs:" ) ;
16
+ assert_contains ( & content, "bar.rs:" ) ;
17
+ assert_contains ( & content, "doc.md:" ) ;
18
+
19
+ // Now we check that we can provide a file name to the `dep-info` argument.
20
+ rustdoc ( ) . input ( "lib.rs" ) . arg ( "-Zunstable-options" ) . emit ( "dep-info=bla.d" ) . run ( ) ;
21
+ assert ! ( path( "bla.d" ) . exists( ) ) ;
22
+ }
0 commit comments