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

test: handle compilation errors when running tests specially in the teamcity runner (#17511)

This commit is contained in:
Petr Makhnev
2023-03-05 12:14:23 +04:00
committed by GitHub
parent 1a48d08d7a
commit c1f249af6c
3 changed files with 20 additions and 1 deletions

View File

@ -466,7 +466,15 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
ts.append_message(.cmd_begin, cmd, mtc)
d_cmd := time.new_stopwatch()
mut status := os.system(cmd)
mut res := os.execute(cmd)
if res.exit_code != 0 {
eprintln(res.output)
} else {
println(res.output)
}
mut status := res.exit_code
mut cmd_duration := d_cmd.elapsed()
ts.append_message_with_duration(.cmd_end, '', cmd_duration, mtc)
@ -498,6 +506,12 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
goto test_passed_system
}
}
// most probably compiler error
if res.output.contains(': error: ') {
ts.append_message(.cannot_compile, 'Cannot compile file ${file}', mtc)
}
ts.benchmark.fail()
tls_bench.fail()
ts.add_failed_cmd(cmd)