summaryrefslogtreecommitdiffstats
path: root/src/testdir/shared.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-05-05 15:47:19 +0200
committerBram Moolenaar <Bram@vim.org>2018-05-05 15:47:19 +0200
commit248be5c5de723c4e2715c574fd920b8b1a1dfebb (patch)
treeab2b73b2060443d2c7e243a5f36bf89b6a5b3c38 /src/testdir/shared.vim
parentc3e81694fca484ebabd99f3637bd83b9ee2dd50a (diff)
patch 8.0.1793: no test for "vim -g"v8.0.1793
Problem: No test for "vim -g". Solution: Add a test for "-g" and "-y".
Diffstat (limited to 'src/testdir/shared.vim')
-rw-r--r--src/testdir/shared.vim21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim
index 6f4cbeec0a..69114092aa 100644
--- a/src/testdir/shared.vim
+++ b/src/testdir/shared.vim
@@ -227,6 +227,8 @@ func GetVimProg()
return readfile('vimcmd')[0]
endfunc
+let g:valgrind_cnt = 1
+
" Get the command to run Vim, with -u NONE and --not-a-term arguments.
" If there is an argument use it instead of "NONE".
func GetVimCommand(...)
@@ -244,14 +246,26 @@ func GetVimCommand(...)
" For Unix Makefile writes the command to use in the second line of the
" "vimcmd" file, including environment options.
" Other Makefiles just write the executable in the first line, so fall back
- " to that if there is no second line.
- let cmd = get(lines, 1, lines[0])
+ " to that if there is no second line or it is empty.
+ if len(lines) > 1 && lines[1] != ''
+ let cmd = lines[1]
+ else
+ let cmd = lines[0]
+ endif
+
let cmd = substitute(cmd, '-u \f\+', '-u ' . name, '')
if cmd !~ '-u '. name
let cmd = cmd . ' -u ' . name
endif
let cmd .= ' --not-a-term'
let cmd = substitute(cmd, 'VIMRUNTIME=.*VIMRUNTIME;', '', '')
+
+ " If using valgrind, make sure every run uses a different log file.
+ if cmd =~ 'valgrind.*--log-file='
+ let cmd = substitute(cmd, '--log-file=\(^\s*\)', '--log-file=\1.' . g:valgrind_cnt, '')
+ let g:valgrind_cnt += 1
+ endif
+
return cmd
endfunc
@@ -274,9 +288,6 @@ endfunc
func RunVimPiped(before, after, arguments, pipecmd)
let cmd = GetVimCommand()
- if cmd == ''
- return 0
- endif
let args = ''
if len(a:before) > 0
call writefile(a:before, 'Xbefore.vim')