File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ fn run_unit_tests(
126126 script_meta,
127127 } in compilation. tests . iter ( )
128128 {
129- let ( exe_display, cmd) = cmd_builds (
129+ let ( exe_display, mut cmd) = cmd_builds (
130130 config,
131131 cwd,
132132 unit,
@@ -136,6 +136,11 @@ fn run_unit_tests(
136136 compilation,
137137 "unittests" ,
138138 ) ?;
139+
140+ if config. extra_verbose ( ) {
141+ cmd. display_env_vars ( ) ;
142+ }
143+
139144 config
140145 . shell ( )
141146 . concise ( |shell| shell. status ( "Running" , & exe_display) ) ?;
@@ -266,9 +271,14 @@ fn run_doc_tests(
266271 p. arg ( "-Zunstable-options" ) ;
267272 }
268273
274+ if config. extra_verbose ( ) {
275+ p. display_env_vars ( ) ;
276+ }
277+
269278 config
270279 . shell ( )
271280 . verbose ( |shell| shell. status ( "Running" , p. to_string ( ) ) ) ?;
281+
272282 if let Err ( e) = p. exec ( ) {
273283 let code = fail_fast_code ( & e) ;
274284 let unit_err = UnitTestError {
Original file line number Diff line number Diff line change @@ -4861,3 +4861,24 @@ error: unexpected argument `--keep-going` found
48614861 . with_status ( 101 )
48624862 . run ( ) ;
48634863}
4864+
4865+ #[ cargo_test]
4866+ fn print_env_verbose ( ) {
4867+ let p = project ( )
4868+ . file ( "Cargo.toml" , & basic_manifest ( "foo" , "0.0.1" ) )
4869+ . file ( "src/lib.rs" , "" )
4870+ . build ( ) ;
4871+
4872+ p. cargo ( "test -vv" )
4873+ . with_stderr (
4874+ "\
4875+ [COMPILING] foo v0.0.1 ([CWD])
4876+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name foo[..]`
4877+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name foo[..]`
4878+ [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
4879+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] [CWD]/target/debug/deps/foo-[..][EXE]`
4880+ Doc-tests foo
4881+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustdoc --crate-type lib --crate-name foo[..]" ,
4882+ )
4883+ . run ( ) ;
4884+ }
You can’t perform that action at this time.
0 commit comments