File tree 4 files changed +46
-21
lines changed
tests/run-make/doctests-runtool
4 files changed +46
-21
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,13 @@ impl Rustdoc {
93
93
}
94
94
}
95
95
96
+ /// Specify the edition year.
97
+ pub fn edition ( & mut self , edition : & str ) -> & mut Self {
98
+ self . cmd . arg ( "--edition" ) ;
99
+ self . cmd . arg ( edition) ;
100
+ self
101
+ }
102
+
96
103
#[ track_caller]
97
104
pub fn run_fail_assert_exit_code ( & mut self , code : i32 ) -> Output {
98
105
let caller_location = std:: panic:: Location :: caller ( ) ;
Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ run-make/dep-graph/Makefile
44
44
run-make/dep-info-doesnt-run-much/Makefile
45
45
run-make/dep-info-spaces/Makefile
46
46
run-make/dep-info/Makefile
47
- run-make/doctests-runtool/Makefile
48
47
run-make/dump-ice-to-disk/Makefile
49
48
run-make/dump-mono-stats/Makefile
50
49
run-make/duplicate-output-flavors/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // Tests behavior of rustdoc `--runtool`.
2
+
3
+ use run_make_support:: { rustc, rustdoc, tmp_dir} ;
4
+ use std:: env:: current_dir;
5
+ use std:: fs:: { create_dir, remove_dir_all} ;
6
+ use std:: path:: PathBuf ;
7
+
8
+ fn mkdir ( name : & str ) -> PathBuf {
9
+ let dir = tmp_dir ( ) . join ( name) ;
10
+ create_dir ( & dir) . expect ( "failed to create doctests folder" ) ;
11
+ dir
12
+ }
13
+
14
+ // Behavior with --runtool with relative paths and --test-run-directory.
15
+ fn main ( ) {
16
+ let run_dir_name = "rundir" ;
17
+ let run_dir = mkdir ( run_dir_name) ;
18
+ let run_tool = mkdir ( "runtool" ) ;
19
+ let run_tool_binary = run_tool. join ( "runtool" ) ;
20
+
21
+ rustc ( ) . input ( "t.rs" ) . crate_type ( "rlib" ) . run ( ) ;
22
+ rustc ( ) . input ( "runtool.rs" ) . arg ( "-o" ) . arg ( & run_tool_binary) . run ( ) ;
23
+
24
+ rustdoc ( )
25
+ . input ( current_dir ( ) . unwrap ( ) . join ( "t.rs" ) )
26
+ . arg ( "-Zunstable-options" )
27
+ . arg ( "--test" )
28
+ . arg ( "--test-run-directory" )
29
+ . arg ( run_dir_name)
30
+ . arg ( "--runtool" )
31
+ . arg ( & run_tool_binary)
32
+ . arg ( "--extern" )
33
+ . arg ( "t=libt.rlib" )
34
+ . current_dir ( tmp_dir ( ) )
35
+ . run ( ) ;
36
+
37
+ remove_dir_all ( run_dir) ;
38
+ remove_dir_all ( run_tool) ;
39
+ }
You can’t perform that action at this time.
0 commit comments