summaryrefslogtreecommitdiff
path: root/src/testdir/shared.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-20 15:51:40 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-20 15:51:40 +0100
commitda65058a9c4774dc534c7ae98d24c58b5db669fa (patch)
tree3b9c05511fd12c806a8cbec528b30f073c24cbe5 /src/testdir/shared.vim
parent7a76092a51fc5446426a4bfd9eb6503ec61bf9e9 (diff)
downloadvim-git-da65058a9c4774dc534c7ae98d24c58b5db669fa.tar.gz
patch 8.0.1526: no test using a screen dump yetv8.0.1526
Problem: No test using a screen dump yet. Solution: Add a test for C syntax highlighting. Add helper functions.
Diffstat (limited to 'src/testdir/shared.vim')
-rw-r--r--src/testdir/shared.vim18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim
index 8042428cf..b16fdce3e 100644
--- a/src/testdir/shared.vim
+++ b/src/testdir/shared.vim
@@ -178,17 +178,20 @@ endfunc
" The Makefile writes it as the first line in the "vimcmd" file.
func GetVimProg()
if !filereadable('vimcmd')
- return ''
+ " Assume the script was sourced instead of running "make".
+ return '../vim'
endif
return readfile('vimcmd')[0]
endfunc
" Get the command to run Vim, with -u NONE and --not-a-term arguments.
" If there is an argument use it instead of "NONE".
-" Returns an empty string on error.
func GetVimCommand(...)
if !filereadable('vimcmd')
- return ''
+ echo 'Cannot read the "vimcmd" file, falling back to ../vim.'
+ let lines = ['../vim']
+ else
+ let lines = readfile('vimcmd')
endif
if a:0 == 0
let name = 'NONE'
@@ -199,7 +202,6 @@ func GetVimCommand(...)
" "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 lines = readfile('vimcmd')
let cmd = get(lines, 1, lines[0])
let cmd = substitute(cmd, '-u \f\+', '-u ' . name, '')
if cmd !~ '-u '. name
@@ -210,6 +212,14 @@ func GetVimCommand(...)
return cmd
endfunc
+" Get the command to run Vim, with --clean.
+func GetVimCommandClean()
+ let cmd = GetVimCommand()
+ let cmd = substitute(cmd, '-u NONE', '--clean', '')
+ let cmd = substitute(cmd, '--not-a-term', '', '')
+ return cmd
+endfunc
+
" Run Vim, using the "vimcmd" file and "-u NORC".
" "before" is a list of Vim commands to be executed before loading plugins.
" "after" is a list of Vim commands to be executed after loading plugins.