tests: simplify cmd/tools/modules/testing/common.v
parent
cbb24d34c9
commit
b4c529066a
|
@ -37,7 +37,6 @@ pub mut:
|
||||||
vroot string
|
vroot string
|
||||||
vtmp_dir string
|
vtmp_dir string
|
||||||
vargs string
|
vargs string
|
||||||
failed bool
|
|
||||||
fail_fast bool
|
fail_fast bool
|
||||||
benchmark benchmark.Benchmark
|
benchmark benchmark.Benchmark
|
||||||
rm_binaries bool = true
|
rm_binaries bool = true
|
||||||
|
@ -288,7 +287,7 @@ pub fn (mut ts TestSession) test() {
|
||||||
fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
||||||
mut ts := &TestSession(p.get_shared_context())
|
mut ts := &TestSession(p.get_shared_context())
|
||||||
if ts.fail_fast {
|
if ts.fail_fast {
|
||||||
if ts.failed {
|
if ts.failed_cmds.len > 0 {
|
||||||
return pool.no_result
|
return pool.no_result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,7 +379,6 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
||||||
goto test_passed_system
|
goto test_passed_system
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ts.failed = true
|
|
||||||
ts.benchmark.fail()
|
ts.benchmark.fail()
|
||||||
tls_bench.fail()
|
tls_bench.fail()
|
||||||
ts.add_failed_cmd(cmd)
|
ts.add_failed_cmd(cmd)
|
||||||
|
@ -396,7 +394,6 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
||||||
}
|
}
|
||||||
mut r := os.execute(cmd)
|
mut r := os.execute(cmd)
|
||||||
if r.exit_code < 0 {
|
if r.exit_code < 0 {
|
||||||
ts.failed = true
|
|
||||||
ts.benchmark.fail()
|
ts.benchmark.fail()
|
||||||
tls_bench.fail()
|
tls_bench.fail()
|
||||||
ts.append_message(.fail, tls_bench.step_message_fail(normalised_relative_file))
|
ts.append_message(.fail, tls_bench.step_message_fail(normalised_relative_file))
|
||||||
|
@ -422,7 +419,6 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
||||||
goto test_passed_execute
|
goto test_passed_execute
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ts.failed = true
|
|
||||||
ts.benchmark.fail()
|
ts.benchmark.fail()
|
||||||
tls_bench.fail()
|
tls_bench.fail()
|
||||||
ending_newline := if r.output.ends_with('\n') { '\n' } else { '' }
|
ending_newline := if r.output.ends_with('\n') { '\n' } else { '' }
|
||||||
|
@ -510,7 +506,7 @@ pub fn v_build_failing_skipped(zargs string, folder string, oskipped []string, c
|
||||||
cb(mut session)
|
cb(mut session)
|
||||||
session.test()
|
session.test()
|
||||||
eprintln(session.benchmark.total_message(finish_label))
|
eprintln(session.benchmark.total_message(finish_label))
|
||||||
return session.failed
|
return session.failed_cmds.len > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_v_cmd_failed(cmd string) bool {
|
pub fn build_v_cmd_failed(cmd string) bool {
|
||||||
|
|
|
@ -43,7 +43,7 @@ fn main() {
|
||||||
// eprintln('> session.skip_files: $session.skip_files')
|
// eprintln('> session.skip_files: $session.skip_files')
|
||||||
session.test()
|
session.test()
|
||||||
eprintln(session.benchmark.total_message(finish_label))
|
eprintln(session.benchmark.total_message(finish_label))
|
||||||
if session.failed {
|
if session.failed_cmds.len > 0 {
|
||||||
exit(1)
|
exit(1)
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
|
@ -69,7 +69,7 @@ fn main() {
|
||||||
testing.header('Testing...')
|
testing.header('Testing...')
|
||||||
ts.test()
|
ts.test()
|
||||||
println(ts.benchmark.total_message('all V _test.v files'))
|
println(ts.benchmark.total_message('all V _test.v files'))
|
||||||
if ts.failed {
|
if ts.failed_cmds.len > 0 {
|
||||||
exit(1)
|
exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue