diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index 3a402e4..9d5522a 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -20,6 +20,7 @@ use lexarg_error::ErrorContext; /// /// To parse, see [`TestOptsBuilder`] #[derive(Debug, Default)] +#[non_exhaustive] pub struct TestOpts { pub list: bool, pub filters: Vec, @@ -27,7 +28,8 @@ pub struct TestOpts { pub run_ignored: RunIgnored, pub run_tests: bool, pub bench_benchmarks: bool, - pub nocapture: bool, + pub no_capture: bool, + pub show_output: bool, pub color: ColorConfig, pub format: OutputFormat, pub test_threads: Option, @@ -36,7 +38,6 @@ pub struct TestOpts { /// May run a few more tests due to threading, but will /// abort as soon as possible. pub fail_fast: bool, - pub options: Options, pub allowed_unstable: Vec, } @@ -86,16 +87,6 @@ impl Default for OutputFormat { } } -/// Options for the test run defined by the caller (instead of CLI arguments) (see -/// [`TestOpts::options`]) -/// -/// In case we want to add other options as well, just add them in this struct. -#[derive(Copy, Clone, Debug, Default)] -pub struct Options { - pub display_output: bool, - pub panic_abort: bool, -} - pub const UNSTABLE_OPTIONS: &str = "unstable-options"; pub const OPTIONS_HELP: &str = r#" @@ -201,7 +192,7 @@ impl TestOptsBuilder { self.opts.list = true; } Long("no-capture") => { - self.opts.nocapture = true; + self.opts.no_capture = true; } Long("test-threads") => { let test_threads = parser @@ -257,7 +248,7 @@ impl TestOptsBuilder { }); } Long("show-output") => { - self.opts.options.display_output = true; + self.opts.show_output = true; } Short("Z") => { let feature = parser diff --git a/crates/libtest2-harness/src/harness.rs b/crates/libtest2-harness/src/harness.rs index 129c186..a11268c 100644 --- a/crates/libtest2-harness/src/harness.rs +++ b/crates/libtest2-harness/src/harness.rs @@ -247,15 +247,12 @@ fn run( notifier.notify(notify::Event::SuiteStart)?; let timer = std::time::Instant::now(); - if opts.nocapture { + if opts.no_capture { todo!("`--no-capture` is not yet supported"); } - if opts.options.display_output { + if opts.show_output { todo!("`--show-output` is not yet supported"); } - if opts.options.panic_abort { - todo!("panic-abort is not yet supported"); - } let threads = opts.test_threads.map(|t| t.get()).unwrap_or(1);