File tree 2 files changed +31
-1
lines changed 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ fn run_unit_tests(
126
126
script_meta,
127
127
} in compilation. tests . iter ( )
128
128
{
129
- let ( exe_display, cmd) = cmd_builds (
129
+ let ( exe_display, mut cmd) = cmd_builds (
130
130
config,
131
131
cwd,
132
132
unit,
@@ -136,6 +136,11 @@ fn run_unit_tests(
136
136
compilation,
137
137
"unittests" ,
138
138
) ?;
139
+
140
+ if config. extra_verbose ( ) {
141
+ cmd. display_env_vars ( ) ;
142
+ }
143
+
139
144
config
140
145
. shell ( )
141
146
. concise ( |shell| shell. status ( "Running" , & exe_display) ) ?;
@@ -266,9 +271,14 @@ fn run_doc_tests(
266
271
p. arg ( "-Zunstable-options" ) ;
267
272
}
268
273
274
+ if config. extra_verbose ( ) {
275
+ p. display_env_vars ( ) ;
276
+ }
277
+
269
278
config
270
279
. shell ( )
271
280
. verbose ( |shell| shell. status ( "Running" , p. to_string ( ) ) ) ?;
281
+
272
282
if let Err ( e) = p. exec ( ) {
273
283
let code = fail_fast_code ( & e) ;
274
284
let unit_err = UnitTestError {
Original file line number Diff line number Diff line change @@ -4861,3 +4861,23 @@ error: unexpected argument `--keep-going` found
4861
4861
. with_status ( 101 )
4862
4862
. run ( ) ;
4863
4863
}
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
+ [COMPILING] foo v0.0.1 ([CWD])
4875
+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name foo[..]`
4876
+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name foo[..]`
4877
+ [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
4878
+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] [CWD]/target/debug/deps/foo-[..][EXE]`
4879
+ Doc-tests foo
4880
+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustdoc --crate-type lib --crate-name foo[..]"
4881
+ )
4882
+ . run ( ) ;
4883
+ }
You can’t perform that action at this time.
0 commit comments