Skip to content

Commit 7802d6e

Browse files
committed
Fix thread '<main>' panicked at 'No option 'nocapture' defined'
1 parent 4c196ff commit 7802d6e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustc-test"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
description = "A fork of Rust’s `test` crate that doesn’t require unstable language features."

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
404404
let bench_benchmarks = matches.opt_present("bench");
405405
let run_tests = !bench_benchmarks || matches.opt_present("test");
406406

407-
let mut nocapture = matches.opt_present("nocapture");
407+
let mut nocapture =
408+
if cfg!(feature = "capture") { matches.opt_present("nocapture") } else { true };
408409
if !nocapture {
409410
nocapture = env::var("RUST_TEST_NOCAPTURE").is_ok();
410411
}

0 commit comments

Comments
 (0)