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