return cmd
endfunc
+" Return one when it looks like the tests are run with valgrind, which means
+" that everything is much slower.
+func RunningWithValgrind()
+ return GetVimCommand() =~ '\<valgrind\>'
+endfunc
+
" Get the command to run Vim, with --clean instead of "-u NONE".
func GetVimCommandClean()
let cmd = GetVimCommand()
# Start Vim in a terminal
var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
- call g:TermWait(buf)
+ call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50)
# Despite the failure the functions are defined
g:RunDbgCmd(buf, ':function g:EarlyFunc',
# Start Vim in a terminal
var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
- call g:TermWait(buf)
+ call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50)
g:RunDbgCmd(buf, ':call GetNum()',
['line 1: return 1 + 2 + 3'], {match: 'pattern'})
let ms = 1
let min_time = 0.001
let max_time = min_time * 10.0
- if GetVimCommand() =~ 'valgrind.*--log-file='
+ if RunningWithValgrind()
let max_time += 0.04 " this can be slow with valgrind
endif
endif