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

tools: support VJOBS=1 VTEST_FAIL_FAST=1 ./v test .

This commit is contained in:
Delyan Angelov
2021-11-15 11:44:54 +02:00
parent 5e75c89b71
commit 7b723262e4
2 changed files with 29 additions and 7 deletions

View File

@ -9,13 +9,15 @@ import v.pref
import v.util.vtest
import runtime
const github_job = os.getenv('GITHUB_JOB')
pub const github_job = os.getenv('GITHUB_JOB')
const show_start = os.getenv('VTEST_SHOW_START') == '1'
pub const show_start = os.getenv('VTEST_SHOW_START') == '1'
const hide_skips = os.getenv('VTEST_HIDE_SKIP') == '1'
pub const hide_skips = os.getenv('VTEST_HIDE_SKIP') == '1'
const hide_oks = os.getenv('VTEST_HIDE_OK') == '1'
pub const hide_oks = os.getenv('VTEST_HIDE_OK') == '1'
pub const fail_fast = os.getenv('VTEST_FAIL_FAST') == '1'
pub struct TestSession {
pub mut:
@ -26,6 +28,7 @@ pub mut:
vtmp_dir string
vargs string
failed bool
fail_fast bool
benchmark benchmark.Benchmark
rm_binaries bool = true
silent_mode bool
@ -186,6 +189,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession {
vexe: vexe
vroot: vroot
skip_files: skip_files
fail_fast: testing.fail_fast
vargs: vargs
vtmp_dir: new_vtmp_dir
silent_mode: _vargs.contains('-silent')
@ -258,6 +262,11 @@ pub fn (mut ts TestSession) test() {
fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
mut ts := &TestSession(p.get_shared_context())
if ts.fail_fast {
if ts.failed {
return pool.no_result
}
}
tmpd := ts.vtmp_dir
show_stats := '-stats' in ts.vargs.split(' ')
// tls_bench is used to format the step messages/timings