Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions crates/libtest-lexarg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ use lexarg_error::ErrorContext;
///
/// To parse, see [`TestOptsBuilder`]
#[derive(Debug, Default)]
#[non_exhaustive]
pub struct TestOpts {
pub list: bool,
pub filters: Vec<String>,
pub filter_exact: bool,
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<std::num::NonZeroUsize>,
Expand All @@ -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<String>,
}

Expand Down Expand Up @@ -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#"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions crates/libtest2-harness/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading