mirror of
https://github.com/vlang/v.git
synced 2025-09-10 07:47:20 -04:00
tools: add SKIP_TESTS env variable support for parser_speed.v and scanner_speed.v
This commit is contained in:
parent
68d962f6b3
commit
56644b2b52
@ -6,6 +6,8 @@ import v.parser
|
|||||||
import v.errors
|
import v.errors
|
||||||
import v.scanner
|
import v.scanner
|
||||||
|
|
||||||
|
const skip_tests = os.getenv_opt('SKIP_TESTS') or { '' }.bool()
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
files := os.args#[1..]
|
files := os.args#[1..]
|
||||||
if files.len > 0 && files[0].starts_with('@') {
|
if files.len > 0 && files[0].starts_with('@') {
|
||||||
@ -31,7 +33,7 @@ fn process_files(files []string) ! {
|
|||||||
if f == '' {
|
if f == '' {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if f.ends_with('_test.v') {
|
if skip_tests && f.ends_with('_test.v') {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// do not measure the scanning, but only the parsing:
|
// do not measure the scanning, but only the parsing:
|
||||||
|
@ -3,6 +3,8 @@ import time
|
|||||||
import v.scanner
|
import v.scanner
|
||||||
import v.pref
|
import v.pref
|
||||||
|
|
||||||
|
const skip_tests = os.getenv_opt('SKIP_TESTS') or { '' }.bool()
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
files := os.args#[1..]
|
files := os.args#[1..]
|
||||||
if files.len > 0 && files[0].starts_with('@') {
|
if files.len > 0 && files[0].starts_with('@') {
|
||||||
@ -27,7 +29,7 @@ fn process_files(files []string) ! {
|
|||||||
if f == '' {
|
if f == '' {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if f.ends_with('_test.v') {
|
if skip_tests && f.ends_with('_test.v') {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
sw.restart()
|
sw.restart()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user