summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-08-24 23:23:29 +0800
committerGitHub <noreply@github.com>2021-08-24 17:23:29 +0200
commita7240c5091e757da1285c2f655796d4e62e54bb3 (patch)
tree403e6c36dcf8816f207b51f51a80667f1b2e3acb /cli/flags.rs
parent7ae30bcc89829a8e4d101deeb3a977f488ef7a12 (diff)
feat(cli): add --ignore flag to test command (#11712)
Diffstat (limited to 'cli/flags.rs')
-rw-r--r--cli/flags.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index 53177465d..63182753a 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -99,6 +99,7 @@ pub enum DenoSubcommand {
script: String,
},
Test {
+ ignore: Vec<PathBuf>,
doc: bool,
no_run: bool,
fail_fast: Option<NonZeroUsize>,
@@ -1025,6 +1026,14 @@ fn test_subcommand<'a, 'b>() -> App<'a, 'b> {
runtime_args(SubCommand::with_name("test"), true, true)
.setting(AppSettings::TrailingVarArg)
.arg(
+ Arg::with_name("ignore")
+ .long("ignore")
+ .takes_value(true)
+ .use_delimiter(true)
+ .require_equals(true)
+ .help("Ignore files"),
+ )
+ .arg(
Arg::with_name("no-run")
.long("no-run")
.help("Cache test modules, but don't run tests")
@@ -1768,6 +1777,11 @@ fn run_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
fn test_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
runtime_args_parse(flags, matches, true, true);
+ let ignore = match matches.values_of("ignore") {
+ Some(f) => f.map(PathBuf::from).collect(),
+ None => vec![],
+ };
+
let no_run = matches.is_present("no-run");
let doc = matches.is_present("doc");
let allow_none = matches.is_present("allow-none");
@@ -1836,6 +1850,7 @@ fn test_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
doc,
fail_fast,
include,
+ ignore,
filter,
shuffle,
allow_none,
@@ -3564,6 +3579,7 @@ mod tests {
filter: Some("- foo".to_string()),
allow_none: true,
include: Some(svec!["dir1/", "dir2/"]),
+ ignore: vec![],
shuffle: None,
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
},
@@ -3632,6 +3648,7 @@ mod tests {
allow_none: false,
shuffle: None,
include: None,
+ ignore: vec![],
concurrent_jobs: NonZeroUsize::new(4).unwrap(),
},
..Flags::default()
@@ -3656,6 +3673,7 @@ mod tests {
allow_none: false,
shuffle: None,
include: None,
+ ignore: vec![],
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
},
..Flags::default()
@@ -3684,6 +3702,7 @@ mod tests {
allow_none: false,
shuffle: None,
include: None,
+ ignore: vec![],
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
},
enable_testing_features: true,
@@ -3706,6 +3725,7 @@ mod tests {
allow_none: false,
shuffle: Some(1),
include: None,
+ ignore: vec![],
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
},
watch: false,
@@ -3728,6 +3748,7 @@ mod tests {
allow_none: false,
shuffle: None,
include: None,
+ ignore: vec![],
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
},
watch: true,