diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-15 17:58:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-15 17:58:09 +0200 |
commit | b46fecd3454399f8ebdc5055302e4bfc5a10f98b (patch) | |
tree | de87b06c8fed73aee6e5aa90c300023aa3602afa /src/testdir | |
parent | b6e3b88ec8b757b3acf940f8b4938e975c39ba67 (diff) | |
download | vim-git-b46fecd3454399f8ebdc5055302e4bfc5a10f98b.tar.gz |
patch 8.1.1544: some balloon tests don't run when they canv8.1.1544
Problem: Some balloon tests don't run when they can.
Solution: Split GUI balloon tests off into a separate file. (Ozaki Kiichi,
closes #4538) Change the feature check into a command for
consistency.
Diffstat (limited to 'src/testdir')
54 files changed, 161 insertions, 181 deletions
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 9e551c1e1..eb014a95c 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -65,6 +65,7 @@ NEW_TESTS = \ test_backspace_opt \ test_backup \ test_balloon \ + test_balloon_gui \ test_behave \ test_blob \ test_blockedit \ @@ -297,6 +298,7 @@ NEW_TESTS_RES = \ test_autoload.res \ test_backspace_opt.res \ test_balloon.res \ + test_balloon_gui.res \ test_blob.res \ test_blockedit.res \ test_breakindent.res \ diff --git a/src/testdir/check.vim b/src/testdir/check.vim new file mode 100644 index 000000000..7f37f1c96 --- /dev/null +++ b/src/testdir/check.vim @@ -0,0 +1,23 @@ +" Command to check for the presence of a feature. +command -nargs=1 CheckFeature call CheckFeature(<f-args>) +func CheckFeature(name) + if !has(a:name) + throw 'Skipped: ' .. a:name .. ' feature missing' + endif +endfunc + +" Command to check for the presence of a working option. +command -nargs=1 CheckOption call CheckOption(<f-args>) +func CheckOption(name) + if !exists('+' .. a:name) + throw 'Skipped: ' .. a:name .. ' option not supported' + endif +endfunc + +" Command to check for the presence of a function. +command -nargs=1 CheckFunction call CheckFunction(<f-args>) +func CheckFunction(name) + if !exists('*' .. a:name) + throw 'Skipped: ' .. a:name .. ' function missing' + endif +endfunc diff --git a/src/testdir/test_arabic.vim b/src/testdir/test_arabic.vim index 450c6f98f..b679ec452 100644 --- a/src/testdir/test_arabic.vim +++ b/src/testdir/test_arabic.vim @@ -2,9 +2,8 @@ " NOTE: This just checks if the code works. If you know Arabic please add " functional tests that check the shaping works with real text. -if !has('arabic') - throw 'Skipped: arabic feature missing' -endif +source check.vim +CheckFeature arabic source view_util.vim diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim index abf7d6944..793eb3a57 100644 --- a/src/testdir/test_balloon.vim +++ b/src/testdir/test_balloon.vim @@ -1,11 +1,12 @@ " Tests for 'balloonevalterm'. +" A few tests only work in the terminal. -if !has('balloon_eval_term') - throw 'Skipped: balloon_eval_term feature missing' +if has('gui_running') + throw 'Skipped: only work in the terminal' endif -" A few tests only work in the terminal. -if !has('gui_running') +source check.vim +CheckFeature balloon_eval_term source screendump.vim if !CanRunVimInTerminal() @@ -56,24 +57,3 @@ func Test_balloon_eval_term_visual() call StopVimInTerminal(buf) call delete('XTest_beval_visual') endfunc - -endif - -" Tests that only work in the GUI -if has('gui_running') - -func Test_balloon_show_gui() - let msg = 'this this this this' - call balloon_show(msg) - call assert_equal(msg, balloon_gettext()) - sleep 10m - call balloon_show('') - - let msg = 'that that' - call balloon_show(msg) - call assert_equal(msg, balloon_gettext()) - sleep 10m - call balloon_show('') -endfunc - -endif diff --git a/src/testdir/test_balloon_gui.vim b/src/testdir/test_balloon_gui.vim new file mode 100644 index 000000000..fd01309c1 --- /dev/null +++ b/src/testdir/test_balloon_gui.vim @@ -0,0 +1,22 @@ +" Tests for 'ballooneval' in the GUI. + +if !has('gui_running') + throw 'Skipped: only works in the GUI' +endif + +source check.vim +CheckFeature balloon_eval + +func Test_balloon_show_gui() + let msg = 'this this this this' + call balloon_show(msg) + call assert_equal(msg, balloon_gettext()) + sleep 10m + call balloon_show('') + + let msg = 'that that' + call balloon_show(msg) + call assert_equal(msg, balloon_gettext()) + sleep 10m + call balloon_show('') +endfunc diff --git a/src/testdir/test_crypt.vim b/src/testdir/test_crypt.vim index db100991a..ab62d8470 100644 --- a/src/testdir/test_crypt.vim +++ b/src/testdir/test_crypt.vim @@ -1,8 +1,7 @@ " Tests for encryption. -if !has('cryptv') - throw 'Skipped, encryption feature missing' -endif +source check.vim +CheckFeature cryptv func Common_head_only(text) " This was crashing Vim diff --git a/src/testdir/test_cscope.vim b/src/testdir/test_cscope.vim index a3fcbd77b..c776be113 100644 --- a/src/testdir/test_cscope.vim +++ b/src/testdir/test_cscope.vim @@ -1,10 +1,11 @@ " Test for cscope commands. -if !has('cscope') || !has('quickfix') - throw 'Skipped, cscope or quickfix feature missing' -endif +source check.vim +CheckFeature cscope +CheckFeature quickfix + if !executable('cscope') - throw 'Skipped, cscope program missing' + throw 'Skipped: cscope program missing' endif func CscopeSetupOrClean(setup) diff --git a/src/testdir/test_digraph.vim b/src/testdir/test_digraph.vim index 92d4e479a..6435c86fa 100644 --- a/src/testdir/test_digraph.vim +++ b/src/testdir/test_digraph.vim @@ -1,8 +1,7 @@ " Tests for digraphs -if !has("digraphs") - throw 'Skipped, digraphs feature missing' -endif +source check.vim +CheckFeature digraphs func Put_Dig(chars) exe "norm! o\<c-k>".a:chars diff --git a/src/testdir/test_float_func.vim b/src/testdir/test_float_func.vim index 6340b538f..f407f40eb 100644 --- a/src/testdir/test_float_func.vim +++ b/src/testdir/test_float_func.vim @@ -1,8 +1,7 @@ " test float functions -if !has('float') - throw 'Skipped, float feature missing' -end +source check.vim +CheckFeature float func Test_abs() call assert_equal('1.23', string(abs(1.23))) diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index d030a6ae6..7f94e6a8d 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -2,7 +2,7 @@ source shared.vim if !CanRunGui() - throw 'Skipped, cannot run GUI' + throw 'Skipped: cannot run GUI' endif source setup_gui.vim diff --git a/src/testdir/test_gui_init.vim b/src/testdir/test_gui_init.vim index a8eefa56b..ecc8fc9ef 100644 --- a/src/testdir/test_gui_init.vim +++ b/src/testdir/test_gui_init.vim @@ -3,7 +3,7 @@ source shared.vim if !CanRunGui() - throw 'Skipped, cannot run GUI' + throw 'Skipped: cannot run GUI' endif source setup_gui.vim diff --git a/src/testdir/test_history.vim b/src/testdir/test_history.vim index 4b464137b..215fc0a55 100644 --- a/src/testdir/test_history.vim +++ b/src/testdir/test_history.vim @@ -1,8 +1,7 @@ " Tests for the history functions -if !has('cmdline_hist') - throw 'Skipped, cmdline_hist feature missing' -endif +source check.vim +CheckFeature cmdline_hist set history=7 diff --git a/src/testdir/test_langmap.vim b/src/testdir/test_langmap.vim index 4b260f848..420ff0fe8 100644 --- a/src/testdir/test_langmap.vim +++ b/src/testdir/test_langmap.vim @@ -1,8 +1,7 @@ " tests for 'langmap' -if !has('langmap') - throw 'Skipped, langmap feature missing' -endif +source check.vim +CheckFeature langmap func Test_langmap() new diff --git a/src/testdir/test_listlbr.vim b/src/testdir/test_listlbr.vim index 5af4133ec..a2abc93b7 100644 --- a/src/testdir/test_listlbr.vim +++ b/src/testdir/test_listlbr.vim @@ -3,12 +3,9 @@ set encoding=latin1 scriptencoding latin1 -if !exists("+linebreak") - throw 'Skipped, linebreak option missing' -endif -if !has("conceal") - throw 'Skipped, conceal feature missing' -endif +source check.vim +CheckOption linebreak +CheckFeature conceal source view_util.vim diff --git a/src/testdir/test_listlbr_utf8.vim b/src/testdir/test_listlbr_utf8.vim index 1154d6626..ddce6f36d 100644 --- a/src/testdir/test_listlbr_utf8.vim +++ b/src/testdir/test_listlbr_utf8.vim @@ -3,15 +3,10 @@ set encoding=utf-8 scriptencoding utf-8 -if !exists("+linebreak") - throw 'Skipped, linebreak option missing' -endif -if !has("conceal") - throw 'Skipped, conceal feature missing' -endif -if !has("signs") - throw 'Skipped, signs feature missing' -endif +source check.vim +CheckOption linebreak +CheckFeature conceal +CheckFeature signs source view_util.vim diff --git a/src/testdir/test_lua.vim b/src/testdir/test_lua.vim index 5d2f088e3..65753dc4a 100644 --- a/src/testdir/test_lua.vim +++ b/src/testdir/test_lua.vim @@ -1,8 +1,7 @@ " Tests for Lua. -if !has('lua') - throw 'Skipped, lua feature missing' -endif +source check.vim +CheckFeature lua func TearDown() " Run garbage collection after each test to exercise luaV_setref(). diff --git a/src/testdir/test_makeencoding.vim b/src/testdir/test_makeencoding.vim index 6de3c706f..09d36eac9 100644 --- a/src/testdir/test_makeencoding.vim +++ b/src/testdir/test_makeencoding.vim @@ -4,7 +4,7 @@ source shared.vim let s:python = PythonProg() if s:python == '' - throw 'Skipped, python program missing' + throw 'Skipped: python program missing' endif let s:script = 'test_makeencoding.py' diff --git a/src/testdir/test_matchadd_conceal.vim b/src/testdir/test_matchadd_conceal.vim index a7c8b06f5..6684378f6 100644 --- a/src/testdir/test_matchadd_conceal.vim +++ b/src/testdir/test_matchadd_conceal.vim @@ -1,8 +1,7 @@ " Test for matchadd() and conceal feature -if !has('conceal') - throw 'Skipped, conceal feature missing' -endif +source check.vim +CheckFeature conceal if !has('gui_running') && has('unix') set term=ansi diff --git a/src/testdir/test_matchadd_conceal_utf8.vim b/src/testdir/test_matchadd_conceal_utf8.vim index fb275777d..98ed2cbe6 100644 --- a/src/testdir/test_matchadd_conceal_utf8.vim +++ b/src/testdir/test_matchadd_conceal_utf8.vim @@ -1,8 +1,7 @@ " Test for matchadd() and conceal feature using utf-8. -if !has('conceal') - throw 'Skipped, conceal feature missing' -endif +source check.vim +CheckFeature conceal if !has('gui_running') && has('unix') set term=ansi diff --git a/src/testdir/test_memory_usage.vim b/src/testdir/test_memory_usage.vim index 519ac4b9a..b51a110e0 100644 --- a/src/testdir/test_memory_usage.vim +++ b/src/testdir/test_memory_usage.vim @@ -1,15 +1,15 @@ " Tests for memory usage. -if !has('terminal') - throw 'Skipped, terminal feature missing' -endif +source check.vim +CheckFeature terminal + if has('gui_running') - throw 'Skipped, does not work in GUI' + throw 'Skipped: does not work in GUI' endif if execute('version') =~# '-fsanitize=[a-z,]*\<address\>' " Skip tests on Travis CI ASAN build because it's difficult to estimate " memory usage. - throw 'Skipped, does not work with ASAN' + throw 'Skipped: does not work with ASAN' endif source shared.vim @@ -20,7 +20,7 @@ endfunc if has('win32') if !executable('wmic') - throw 'Skipped, wmic program missing' + throw 'Skipped: wmic program missing' endif func s:memory_usage(pid) abort let cmd = printf('wmic process where processid=%d get WorkingSetSize', a:pid) @@ -28,13 +28,13 @@ if has('win32') endfunc elseif has('unix') if !executable('ps') - throw 'Skipped, ps program missing' + throw 'Skipped: ps program missing' endif func s:memory_usage(pid) abort return s:pick_nr(system('ps -o rss= -p ' . a:pid)) endfunc else - throw 'Skipped, not win32 or unix' + throw 'Skipped: not win32 or unix' endif " Wait for memory usage to level off. diff --git a/src/testdir/test_menu.vim b/src/testdir/test_menu.vim index 99f888af1..efbb982b0 100644 --- a/src/testdir/test_menu.vim +++ b/src/testdir/test_menu.vim @@ -1,8 +1,7 @@ " Test that the system menu can be loaded. -if !has('menu') - throw 'Skipped, menu feature missing' -endif +source check.vim +CheckFeature menu func Test_load_menu() try diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index ee2d148c6..e7aa25ca7 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -3,9 +3,8 @@ set encoding=latin1 scriptencoding latin1 -if !has('mksession') - throw 'Skipped, mksession feature missing' -endif +source check.vim +CheckFeature mksession source shared.vim diff --git a/src/testdir/test_mksession_utf8.vim b/src/testdir/test_mksession_utf8.vim index 6bf5823ce..7d9a909ca 100644 --- a/src/testdir/test_mksession_utf8.vim +++ b/src/testdir/test_mksession_utf8.vim @@ -3,9 +3,8 @@ set encoding=utf-8 scriptencoding utf-8 -if !has('mksession') - throw 'Skipped, mksession feature missing' -endif +source check.vim +CheckFeature mksession func Test_mksession_utf8() tabnew diff --git a/src/testdir/test_netbeans.vim b/src/testdir/test_netbeans.vim index 836bddff3..690ac673c 100644 --- a/src/testdir/test_netbeans.vim +++ b/src/testdir/test_netbeans.vim @@ -1,14 +1,13 @@ " Test the netbeans interface. -if !has('netbeans_intg') - throw 'Skipped, netbeans_intg feature missing' -endif +source check.vim +CheckFeature netbeans_intg source shared.vim let s:python = PythonProg() if s:python == '' - throw 'Skipped, python program missing' + throw 'Skipped: python program missing' endif " Run "testfunc" after sarting the server and stop the server afterwards. diff --git a/src/testdir/test_paste.vim b/src/testdir/test_paste.vim index ee6964153..a22e8e505 100644 --- a/src/testdir/test_paste.vim +++ b/src/testdir/test_paste.vim @@ -2,10 +2,10 @@ " Bracketed paste only works with "xterm". Not in GUI or Windows console. if has('win32') - throw 'Skipped, does not work on MS-Windows' + throw 'Skipped: does not work on MS-Windows' endif if has('gui_running') - throw 'Skipped, does not work in the GUI' + throw 'Skipped: does not work in the GUI' endif set term=xterm diff --git a/src/testdir/test_perl.vim b/src/testdir/test_perl.vim index d38fc0798..8f23f2c13 100644 --- a/src/testdir/test_perl.vim +++ b/src/testdir/test_perl.vim @@ -1,8 +1,7 @@ " Tests for Perl interface -if !has('perl') - throw 'Skipped, perl feature missing' -end +source check.vim +CheckFeature perl " FIXME: RunTest don't see any error when Perl abort... perl $SIG{__WARN__} = sub { die "Unexpected warnings from perl: @_" }; diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index d9b0b295f..a3f2046f4 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -1,8 +1,7 @@ " Tests for popup windows -if !has('textprop') - throw 'Skipped: textprop feature missing' -endif +source check.vim +CheckFeature textprop source screendump.vim @@ -515,7 +514,7 @@ endfunc func Test_popup_time() if !has('timers') - throw 'Skipped, timer feature not supported' + throw 'Skipped: timer feature not supported' endif topleft vnew call setline(1, 'hello') @@ -1176,7 +1175,7 @@ endfunc func Test_notifications() if !has('timers') - throw 'Skipped, timer feature not supported' + throw 'Skipped: timer feature not supported' endif if !CanRunVimInTerminal() throw 'Skipped: cannot make screendumps' diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim index ddabe3a95..babed36db 100644 --- a/src/testdir/test_profile.vim +++ b/src/testdir/test_profile.vim @@ -1,8 +1,7 @@ " Test Vim profiler -if !has('profile') - throw 'Skipped, profile feature missing' -endif +source check.vim +CheckFeature profile func Test_profile_func() let lines =<< trim [CODE] diff --git a/src/testdir/test_prompt_buffer.vim b/src/testdir/test_prompt_buffer.vim index 5cf65d513..58be50bcb 100644 --- a/src/testdir/test_prompt_buffer.vim +++ b/src/testdir/test_prompt_buffer.vim @@ -1,8 +1,7 @@ " Tests for setting 'buftype' to "prompt" -if !has('channel') - throw 'Skipped, channel feature missing' -endif +source check.vim +CheckFeature channel source shared.vim source screendump.vim diff --git a/src/testdir/test_python2.vim b/src/testdir/test_python2.vim index 5b1085228..61cf959ba 100644 --- a/src/testdir/test_python2.vim +++ b/src/testdir/test_python2.vim @@ -1,9 +1,8 @@ " Test for python 2 commands. " TODO: move tests from test87.in here. -if !has('python') - throw 'Skipped, python feature missing' -endif +source check.vim +CheckFeature python func Test_pydo() " Check deleting lines does not trigger ml_get error. diff --git a/src/testdir/test_python3.vim b/src/testdir/test_python3.vim index e001360e7..7f4861920 100644 --- a/src/testdir/test_python3.vim +++ b/src/testdir/test_python3.vim @@ -1,9 +1,8 @@ " Test for python 3 commands. " TODO: move tests from test88.in here. -if !has('python3') - throw 'Skipped, python3 feature missing' -endif +source check.vim +CheckFeature python3 func Test_py3do() " Check deleting lines does not trigger an ml_get error. diff --git a/src/testdir/test_pyx2.vim b/src/testdir/test_pyx2.vim index 64bd579c2..40e93c227 100644 --- a/src/testdir/test_pyx2.vim +++ b/src/testdir/test_pyx2.vim @@ -1,9 +1,8 @@ " Test for pyx* commands and functions with Python 2. set pyx=2 -if !has('python') - throw 'Skipped, python feature missing' -endif +source check.vim +CheckFeature python let s:py2pattern = '^2\.[0-7]\.\d\+' let s:py3pattern = '^3\.\d\+\.\d\+' diff --git a/src/testdir/test_pyx3.vim b/src/testdir/test_pyx3.vim index 1b7bdae79..5dfa6cd21 100644 --- a/src/testdir/test_pyx3.vim +++ b/src/testdir/test_pyx3.vim @@ -1,9 +1,8 @@ " Test for pyx* commands and functions with Python 3. set pyx=3 -if !has('python3') - throw 'Skipped, python3 feature missing' -endif +source check.vim +CheckFeature python3 let s:py2pattern = '^2\.[0-7]\.\d\+' let s:py3pattern = '^3\.\d\+\.\d\+' diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 2fa28c994..7d85f629b 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1,8 +1,7 @@ " Test for the quickfix feature. -if !has('quickfix') - throw 'Skipped, quickfix feature missing' -endif +source check.vim +CheckFeature quickfix set encoding=utf-8 diff --git a/src/testdir/test_quotestar.vim b/src/testdir/test_quotestar.vim index b6dab6b57..d21ab35fc 100644 --- a/src/testdir/test_quotestar.vim +++ b/src/testdir/test_quotestar.vim @@ -2,7 +2,7 @@ source shared.vim if !WorkingClipboard() - throw 'Skipped, no working clipboard' + throw 'Skipped: no working clipboard' endif source shared.vim diff --git a/src/testdir/test_reltime.vim b/src/testdir/test_reltime.vim index 187653910..404ea3f7a 100644 --- a/src/testdir/test_reltime.vim +++ b/src/testdir/test_reltime.vim @@ -1,11 +1,8 @@ " Tests for reltime() -if !has('reltime') - throw 'Skipped, reltime feature missing' -endif -if !has('float') - throw 'Skipped, float feature missing' -endif +source check.vim +CheckFeature reltime +CheckFeature float func Test_reltime() let now = reltime() diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim index dcfdc6244..f679bbd5f 100644 --- a/src/testdir/test_ruby.vim +++ b/src/testdir/test_ruby.vim @@ -1,8 +1,7 @@ " Tests for ruby interface -if !has('ruby') - throw 'Skipped, ruby feature missing' -end +source check.vim +CheckFeature ruby func Test_ruby_change_buffer() call setline(line('$'), ['1 line 1']) diff --git a/src/testdir/test_sha256.vim b/src/testdir/test_sha256.vim index 7f802b143..d0f92b1ba 100644 --- a/src/testdir/test_sha256.vim +++ b/src/testdir/test_sha256.vim @@ -1,11 +1,8 @@ " Tests for the sha256() function. -if !has('cryptv') - throw 'Skipped, cryptv feature missing' -endif -if !exists('*sha256') - throw 'Skipped, sha256 function missing' -endif +source check.vim +CheckFeature cryptv +CheckFunction sha256 function Test_sha256() " test for empty string: diff --git a/src/testdir/test_shortpathname.vim b/src/testdir/test_shortpathname.vim index 564cd9612..2d48f4b71 100644 --- a/src/testdir/test_shortpathname.vim +++ b/src/testdir/test_shortpathname.vim @@ -2,7 +2,7 @@ " Only for use on Win32 systems! if !has('win32') - throw 'Skipped, not on MS-Windows' + throw 'Skipped: not on MS-Windows' endif func TestIt(file, bits, expected) diff --git a/src/testdir/test_signals.vim b/src/testdir/test_signals.vim index 365958a38..44732df88 100644 --- a/src/testdir/test_signals.vim +++ b/src/testdir/test_signals.vim @@ -1,7 +1,7 @@ " Test signal handling. if !has('unix') - throw 'Skipped, not on Unix' + throw 'Skipped: not on Unix' endif source shared.vim diff --git a/src/testdir/test_signs.vim b/src/testdir/test_signs.vim index 4a23e4ba1..3b17eccf0 100644 --- a/src/testdir/test_signs.vim +++ b/src/testdir/test_signs.vim @@ -1,8 +1,7 @@ " Test for signs -if !has('signs') - throw 'Skipped, signs feature missing' -endif +source check.vim +CheckFeature signs func Test_sign() new diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim index 72599fdc1..48bc3b3e2 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -1,8 +1,7 @@ " Test spell checking -if !has('spell') - throw 'Skipped, spell feature missing' -endif +source check.vim +CheckFeature spell func TearDown() set nospell diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim index 8d9d7d35c..c9808bec4 100644 --- a/src/testdir/test_syntax.vim +++ b/src/testdir/test_syntax.vim @@ -1,8 +1,7 @@ " Test for syntax and syntax iskeyword option -if !has("syntax") - throw 'Skipped, syntax feature missing' -endif +source check.vim +CheckFeature syntax source view_util.vim source screendump.vim diff --git a/src/testdir/test_tcl.vim b/src/testdir/test_tcl.vim index 8ccd34c6b..9923a2e33 100644 --- a/src/testdir/test_tcl.vim +++ b/src/testdir/test_tcl.vim @@ -1,8 +1,7 @@ " Tests for the Tcl interface. -if !has('tcl') - throw 'Skipped, tcl feature missing' -end +source check.vim +CheckFeature tcl " Helper function as there is no builtin tcleval() function similar " to perleval, luaevel(), pyeval(), etc. diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index 9d7f6b5fa..c6327db6a 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -2,10 +2,10 @@ " This only works for Unix in a terminal if has('gui_running') - throw 'Skipped, does not work in the GUI' + throw 'Skipped: does not work in the GUI' endif if !has('unix') - throw 'Skipped, not on Unix' + throw 'Skipped: not on Unix' endif source shared.vim diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 09c050aad..f1cd7da33 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1,8 +1,7 @@ " Tests for the terminal window. -if !has('terminal') - throw 'Skipped, terminal feature missing' -endif +source check.vim +CheckFeature terminal source shared.vim source screendump.vim diff --git a/src/testdir/test_terminal_fail.vim b/src/testdir/test_terminal_fail.vim index d010c3b8f..f33ade634 100644 --- a/src/testdir/test_terminal_fail.vim +++ b/src/testdir/test_terminal_fail.vim @@ -2,9 +2,8 @@ " leaks under valgrind. That is because when fork/exec fails memory is not " freed. Since the process exists right away it's not a real leak. -if !has('terminal') - throw 'Skipped, terminal feature missing' -endif +source check.vim +CheckFeature terminal source shared.vim diff --git a/src/testdir/test_textobjects.vim b/src/testdir/test_textobjects.vim index 5366a35fb..a3e3851f4 100644 --- a/src/testdir/test_textobjects.vim +++ b/src/testdir/test_textobjects.vim @@ -1,8 +1,7 @@ " Test for textobjects -if !has('textobjects') - throw 'Skipped, textobjects feature missing' -endif +source check.vim +CheckFeature textobjects func CpoM(line, useM, expected) new diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index cb27f5877..08c079cfa 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -1,9 +1,8 @@ " Tests for defining text property types and adding text properties to the " buffer. -if !has('textprop') - throw 'Skipped, textprop feature missing' -endif +source check.vim +CheckFeature textprop source screendump.vim diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim index 5b09011c7..03391d8f5 100644 --- a/src/testdir/test_timers.vim +++ b/src/testdir/test_timers.vim @@ -1,8 +1,7 @@ " Test for timers -if !has('timers') - throw 'Skipped, timers feature missing' -endif +source check.vim +CheckFeature timers source shared.vim source screendump.vim diff --git a/src/testdir/test_vartabs.vim b/src/testdir/test_vartabs.vim index 640aa0b30..b0f3e15aa 100644 --- a/src/testdir/test_vartabs.vim +++ b/src/testdir/test_vartabs.vim @@ -1,8 +1,7 @@ " Test for variable tabstops -if !has("vartabs") - throw 'Skipped, vartabs feature missing' -endif +source check.vim +CheckFeature vartabs source view_util.vim diff --git a/src/testdir/test_winbar.vim b/src/testdir/test_winbar.vim index 51ef0a863..5e4366717 100644 --- a/src/testdir/test_winbar.vim +++ b/src/testdir/test_winbar.vim @@ -1,8 +1,7 @@ " Test WinBar -if !has('menu') - throw 'Skipped, menu feature missing' -endif +source check.vim +CheckFeature menu source shared.vim diff --git a/src/testdir/test_windows_home.vim b/src/testdir/test_windows_home.vim index da95ed27c..8ac9ce0fd 100644 --- a/src/testdir/test_windows_home.vim +++ b/src/testdir/test_windows_home.vim @@ -1,7 +1,7 @@ " Test for $HOME on Windows. if !has('win32') - throw 'Skipped, not on MS-Windows' + throw 'Skipped: not on MS-Windows' endif let s:env = {} diff --git a/src/testdir/test_xxd.vim b/src/testdir/test_xxd.vim index 63ac574ab..cf47c8a9c 100644 --- a/src/testdir/test_xxd.vim +++ b/src/testdir/test_xxd.vim @@ -2,7 +2,7 @@ if empty($XXD) && executable('..\xxd\xxd.exe') let s:xxd_cmd = '..\xxd\xxd.exe' elseif empty($XXD) || !executable($XXD) - throw 'Skipped, xxd program missing' + throw 'Skipped: xxd program missing' else let s:xxd_cmd = $XXD endif |