mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
fix(test): default to num cpus when no value is given (#10443)
This commit is contained in:
parent
4e6790a5fa
commit
f31ee8d1bf
3 changed files with 4 additions and 3 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -540,6 +540,7 @@ dependencies = [
|
||||||
"lspower",
|
"lspower",
|
||||||
"nix",
|
"nix",
|
||||||
"notify",
|
"notify",
|
||||||
|
"num_cpus",
|
||||||
"os_pipe",
|
"os_pipe",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
|
|
|
@ -56,6 +56,7 @@ libc = "0.2.93"
|
||||||
log = { version = "0.4.14", features = ["serde"] }
|
log = { version = "0.4.14", features = ["serde"] }
|
||||||
lspower = "1.0.0"
|
lspower = "1.0.0"
|
||||||
notify = "5.0.0-pre.7"
|
notify = "5.0.0-pre.7"
|
||||||
|
num_cpus = "1.13.0"
|
||||||
percent-encoding = "2.1.0"
|
percent-encoding = "2.1.0"
|
||||||
pin-project = "1.0.6"
|
pin-project = "1.0.6"
|
||||||
regex = "1.4.3"
|
regex = "1.4.3"
|
||||||
|
|
|
@ -1683,9 +1683,8 @@ fn test_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
|
||||||
if let Some(value) = matches.value_of("jobs") {
|
if let Some(value) = matches.value_of("jobs") {
|
||||||
value.parse().unwrap()
|
value.parse().unwrap()
|
||||||
} else {
|
} else {
|
||||||
// TODO(caspervonb) when no value is given use
|
// TODO(caspervonb) drop the dependency on num_cpus when https://doc.rust-lang.org/std/thread/fn.available_concurrency.html becomes stable.
|
||||||
// https://doc.rust-lang.org/std/thread/fn.available_concurrency.html
|
num_cpus::get()
|
||||||
2
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
1
|
1
|
||||||
|
|
Loading…
Reference in a new issue