mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
feat(bench): add --no-run
flag (#18433)
This commit is contained in:
parent
701099b2a9
commit
a29d88b43b
6 changed files with 36 additions and 0 deletions
|
@ -60,6 +60,7 @@ pub struct BenchFlags {
|
|||
pub files: FileFlags,
|
||||
pub filter: Option<String>,
|
||||
pub json: bool,
|
||||
pub no_run: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
|
@ -804,6 +805,12 @@ fn bench_subcommand() -> Command {
|
|||
.value_parser(value_parser!(PathBuf))
|
||||
.action(ArgAction::Append),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("no-run")
|
||||
.long("no-run")
|
||||
.help("Cache bench modules, but don't run benchmarks")
|
||||
.action(ArgAction::SetTrue),
|
||||
)
|
||||
.arg(watch_arg(false))
|
||||
.arg(no_clear_screen_arg())
|
||||
.arg(script_arg().last(true))
|
||||
|
@ -2368,11 +2375,14 @@ fn bench_parse(flags: &mut Flags, matches: &mut ArgMatches) {
|
|||
Vec::new()
|
||||
};
|
||||
|
||||
let no_run = matches.get_flag("no-run");
|
||||
|
||||
watch_arg_parse(flags, matches, false);
|
||||
flags.subcommand = DenoSubcommand::Bench(BenchFlags {
|
||||
files: FileFlags { include, ignore },
|
||||
filter,
|
||||
json,
|
||||
no_run,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -6482,6 +6492,7 @@ mod tests {
|
|||
"--unstable",
|
||||
"--no-npm",
|
||||
"--no-remote",
|
||||
"--no-run",
|
||||
"--filter",
|
||||
"- foo",
|
||||
"--location",
|
||||
|
@ -6499,6 +6510,7 @@ mod tests {
|
|||
subcommand: DenoSubcommand::Bench(BenchFlags {
|
||||
filter: Some("- foo".to_string()),
|
||||
json: true,
|
||||
no_run: true,
|
||||
files: FileFlags {
|
||||
include: vec![PathBuf::from("dir1/"), PathBuf::from("dir2/")],
|
||||
ignore: vec![],
|
||||
|
@ -6526,6 +6538,7 @@ mod tests {
|
|||
subcommand: DenoSubcommand::Bench(BenchFlags {
|
||||
filter: None,
|
||||
json: false,
|
||||
no_run: false,
|
||||
files: FileFlags {
|
||||
include: vec![],
|
||||
ignore: vec![],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue