Skip to content

Commit

Permalink
vim-patch:8.1.1516: time reported for a test measured wrong
Browse files Browse the repository at this point in the history
Problem:    Time reported for a test measured wrong.
Solution:   Move the computation to the end of RunTheTest(). (Ozaki Kiichi,
            closes vim/vim#4520)
vim/vim@640d4f0
  • Loading branch information
janlazo committed Aug 23, 2020
1 parent 8c49e3d commit 3fac3ca
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/nvim/testdir/runtest.vim
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ func RunTheTest(test)
endtry
endif

let message = 'Executed ' . a:test
if has('reltime')
let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
endif
call add(s:messages, message)
let s:done += 1

if a:test =~ 'Test_nocatch_'
" Function handles errors itself. This avoids skipping commands after the
" error.
Expand Down Expand Up @@ -196,6 +189,13 @@ func RunTheTest(test)
endwhile

exe 'cd ' . save_cwd

let message = 'Executed ' . a:test
if has('reltime')
let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
endif
call add(s:messages, message)
let s:done += 1
endfunc

func AfterTheTest()
Expand Down

0 comments on commit 3fac3ca

Please sign in to comment.