summaryrefslogtreecommitdiff
path: root/src/testdir/runtest.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/runtest.vim')
-rw-r--r--src/testdir/runtest.vim16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 02d4d20e3..f855f6800 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -42,6 +42,10 @@ if &lines < 24 || &columns < 80
cquit
endif
+if has('reltime')
+ let s:start_time = reltime()
+endif
+
" Common with all tests on all systems.
source setup.vim
@@ -99,6 +103,9 @@ endfunc
func RunTheTest(test)
echo 'Executing ' . a:test
+ if has('reltime')
+ let func_start = reltime()
+ endif
" Avoid stopping at the "hit enter" prompt
set nomore
@@ -126,7 +133,11 @@ func RunTheTest(test)
endtry
endif
- call add(s:messages, 'Executing ' . a:test)
+ 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_'
@@ -232,6 +243,9 @@ func FinishTesting()
else
let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')
endif
+ if has('reltime')
+ let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds'
+ endif
echo message
call add(s:messages, message)
if s:fail > 0