1
0
forked from aniani/vim

patch 9.0.0545: when a test is slow and CI times out there is no time info

Problem:    When a test is slow and CI times out there is no time info.
Solution:   Add the elapsed time to the "Executing" message.
This commit is contained in:
Bram Moolenaar
2022-09-22 15:13:00 +01:00
parent fcba86c031
commit daaa3d9965
3 changed files with 13 additions and 4 deletions

View File

@@ -173,11 +173,15 @@ function GetAllocId(name)
return lnum - top - 1
endfunc
let g:func_start = reltime()
func RunTheTest(test)
echoconsole 'Executing ' . a:test
let prefix = ''
if has('reltime')
let func_start = reltime()
let prefix = 'took ' .. reltimestr(reltime(g:func_start)) .. '; now '
let g:func_start = reltime()
endif
echoconsole prefix .. 'Executing ' .. a:test
" Avoid stopping at the "hit enter" prompt
set nomore
@@ -292,7 +296,7 @@ func RunTheTest(test)
let message = 'Executed ' . a:test
if has('reltime')
let message ..= repeat(' ', 50 - len(message))
let time = reltime(func_start)
let time = reltime(g:func_start)
if reltimefloat(time) > 0.1
let message = s:t_bold .. message
endif