Skip to content

Commit

Permalink
[nextest-runner] add --cargo-verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshowers committed Sep 20, 2023
1 parent 464c1bd commit a424955
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cargo-nextest/src/cargo_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use crate::output::OutputContext;
use camino::{Utf8Path, Utf8PathBuf};
use clap::Args;
use clap::{ArgAction, Args};
use std::{borrow::Cow, path::PathBuf};

/// Options passed down to cargo.
Expand Down Expand Up @@ -82,10 +82,14 @@ pub(crate) struct CargoOptions {
#[arg(long, value_name = "NAME", group = "cargo-opts")]
cargo_profile: Option<String>,

/// Run cargo in quiet mode
/// Do not print cargo log messages
#[arg(long, group = "cargo-opts")]
cargo_quiet: bool,

/// Use cargo verbose output (specify twice for very verbose/build.rs output)
#[arg(long, action = ArgAction::Count, group = "cargo-opts")]
cargo_verbose: usize,

/// Number of build jobs to run
#[arg(long, value_name = "JOBS", group = "cargo-opts")]
build_jobs: Option<String>,
Expand Down Expand Up @@ -126,7 +130,6 @@ pub(crate) struct CargoOptions {
#[arg(long, require_equals = true, value_name = "FMTS", group = "cargo-opts")]
timings: Option<Option<String>>,

// --verbose is not currently supported
// --color is handled by runner
/// Require Cargo.lock and cache are up to date
#[arg(long, group = "cargo-opts")]
Expand Down Expand Up @@ -242,6 +245,9 @@ impl<'a> CargoCli<'a> {
if options.cargo_quiet {
self.add_arg("--quiet");
}
if options.cargo_verbose > 0 {
self.add_args(std::iter::repeat("--verbose").take(options.cargo_verbose));
}
if let Some(build_jobs) = &options.build_jobs {
self.add_args(["--jobs", build_jobs.as_str()]);
}
Expand Down

0 comments on commit a424955

Please sign in to comment.