1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tooling: use term.header for tests

This commit is contained in:
Delyan Angelov
2020-02-08 18:01:10 +02:00
committed by GitHub
parent 9d8116f895
commit 4bb5d7de8b
5 changed files with 38 additions and 16 deletions

View File

@@ -4,6 +4,8 @@
module runtime
import os
//$if linux {
fn C.sysconf(name int) i64
//}
@@ -19,6 +21,16 @@ pub fn nr_cpus() int {
return nr_cpus_nix()
}
pub fn nr_jobs() int {
mut cpus := nr_cpus()
// allow for overrides, for example using `VJOBS=32 ./v test .`
vjobs := os.getenv('VJOBS').int()
if vjobs > 0 {
cpus = vjobs
}
return cpus
}
pub fn is_32bit() bool {
mut x := false
$if x32 { x = true }