@@ -151,6 +151,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
151
151
)
152
152
. optflag ( "" , "force-rerun" , "rerun tests even if the inputs are unchanged" )
153
153
. optflag ( "" , "only-modified" , "only run tests that result been modified" )
154
+ . optflag ( "" , "nocapture" , "" )
154
155
. optflag ( "h" , "help" , "show this message" )
155
156
. reqopt ( "" , "channel" , "current Rust channel" , "CHANNEL" )
156
157
. optopt ( "" , "edition" , "default Rust edition" , "EDITION" ) ;
@@ -304,6 +305,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
304
305
force_rerun : matches. opt_present ( "force-rerun" ) ,
305
306
306
307
target_cfg : LazyCell :: new ( ) ,
308
+
309
+ nocapture : matches. opt_present ( "nocapture" ) ,
307
310
}
308
311
}
309
312
@@ -496,6 +499,13 @@ fn configure_lldb(config: &Config) -> Option<Config> {
496
499
}
497
500
498
501
pub fn test_opts ( config : & Config ) -> test:: TestOpts {
502
+ if env:: var ( "RUST_TEST_NOCAPTURE" ) . is_ok ( ) {
503
+ eprintln ! (
504
+ "WARNING: RUST_TEST_NOCAPTURE is no longer used. \
505
+ Use the `--nocapture` flag instead."
506
+ ) ;
507
+ }
508
+
499
509
test:: TestOpts {
500
510
exclude_should_panic : false ,
501
511
filters : config. filters . clone ( ) ,
@@ -505,10 +515,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
505
515
logfile : config. logfile . clone ( ) ,
506
516
run_tests : true ,
507
517
bench_benchmarks : true ,
508
- nocapture : match env:: var ( "RUST_TEST_NOCAPTURE" ) {
509
- Ok ( val) => & val != "0" ,
510
- Err ( _) => false ,
511
- } ,
518
+ nocapture : config. nocapture ,
512
519
color : config. color ,
513
520
shuffle : false ,
514
521
shuffle_seed : None ,
0 commit comments