File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
tests/run-make/rustdoc-remapped-paths Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ pub struct MyStruct {
2+ field : u32 ,
3+ }
4+
5+ impl MyStruct {
6+ pub fn new ( ) -> MyStruct {
7+ MyStruct { field : 3 }
8+ }
9+ }
Original file line number Diff line number Diff line change 1+ extern crate dep;
2+
3+ pub use dep:: MyStruct ;
Original file line number Diff line number Diff line change 1+ use run_make_support:: { cwd, rfs, rustc, rustdoc} ;
2+
3+ fn main ( ) {
4+ // 1. Let's compile the `dep` crate with some `--remap-path-prefix`
5+ rustc ( )
6+ . input ( "dep.rs" )
7+ . crate_type ( "lib" )
8+ . arg ( format ! ( "--remap-path-prefix={}=" , cwd( ) . display( ) ) )
9+ . run ( ) ;
10+
11+ // 2. Let's generate the documentation for the `dep` crate
12+ // in order to have it's sources generated
13+ rustdoc ( ) . input ( "dep.rs" ) . crate_type ( "lib" ) . run ( ) ;
14+
15+ // 3. Let's generate the documentation for the `reexport` crate
16+ // with `dep` as dependency
17+ rustdoc ( ) . input ( "reexport.rs" ) . crate_type ( "lib" ) . extern_ ( "dep" , "libdep.rlib" ) . run ( ) ;
18+
19+ // Let's verify that "Source" links for dep exist in `MyStruct` page
20+ let reexport_MyStruct_content = rfs:: read_to_string ( "doc/reexport/struct.MyStruct.html" ) ;
21+ // FIXME: Those assert don't work!
22+ assert ! ( reexport_MyStruct_content. contains( r#""../src/dep/dep.rs.html#1">Source"# ) ) ;
23+ assert ! ( reexport_MyStruct_content. contains( r#""../src/dep/dep.rs.html#6">Source"# ) ) ;
24+ }
You can’t perform that action at this time.
0 commit comments