]> granicus.if.org Git - vim/commitdiff
patch 8.1.1524: tests are silently skipped v8.1.1524
authorBram Moolenaar <Bram@vim.org>
Thu, 13 Jun 2019 20:19:53 +0000 (22:19 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 Jun 2019 20:19:53 +0000 (22:19 +0200)
Problem:    Tests are silently skipped.
Solution:   Throw an exception for skipped tests in more places.

51 files changed:
src/testdir/shared.vim
src/testdir/test_assert.vim
src/testdir/test_crypt.vim
src/testdir/test_cscope.vim
src/testdir/test_digraph.vim
src/testdir/test_float_func.vim
src/testdir/test_gui.vim
src/testdir/test_gui_init.vim
src/testdir/test_history.vim
src/testdir/test_langmap.vim
src/testdir/test_listlbr.vim
src/testdir/test_listlbr_utf8.vim
src/testdir/test_lua.vim
src/testdir/test_makeencoding.vim
src/testdir/test_matchadd_conceal.vim
src/testdir/test_matchadd_conceal_utf8.vim
src/testdir/test_memory_usage.vim
src/testdir/test_menu.vim
src/testdir/test_mksession.vim
src/testdir/test_mksession_utf8.vim
src/testdir/test_netbeans.vim
src/testdir/test_paste.vim
src/testdir/test_perl.vim
src/testdir/test_profile.vim
src/testdir/test_prompt_buffer.vim
src/testdir/test_python2.vim
src/testdir/test_python3.vim
src/testdir/test_pyx2.vim
src/testdir/test_pyx3.vim
src/testdir/test_quickfix.vim
src/testdir/test_quotestar.vim
src/testdir/test_reltime.vim
src/testdir/test_ruby.vim
src/testdir/test_sha256.vim
src/testdir/test_shortpathname.vim
src/testdir/test_signals.vim
src/testdir/test_signs.vim
src/testdir/test_spell.vim
src/testdir/test_syntax.vim
src/testdir/test_tcl.vim
src/testdir/test_termcodes.vim
src/testdir/test_terminal.vim
src/testdir/test_terminal_fail.vim
src/testdir/test_textobjects.vim
src/testdir/test_textprop.vim
src/testdir/test_timers.vim
src/testdir/test_vartabs.vim
src/testdir/test_winbar.vim
src/testdir/test_windows_home.vim
src/testdir/test_xxd.vim
src/version.c

index 4546be7f7404db687927ef2e686a0b94e12a0f70..ae023a73b9a2ad15185c8e8496740eb323ead9e2 100644 (file)
@@ -330,7 +330,7 @@ endfunc
 
 " Get line "lnum" as displayed on the screen.
 " Trailing white space is trimmed.
-func! Screenline(lnum)
+func Screenline(lnum)
   let chars = []
   for c in range(1, winwidth(0))
     call add(chars, nr2char(screenchar(a:lnum, c)))
index 7df641c6a4d4be3cadafce4870498da2d4023c33..0d59a43a2de0e89943f26b4880094d847edfa63c 100644 (file)
@@ -222,6 +222,25 @@ func Test_override()
   call assert_fails("call test_override('redraw', 'yes')", 'E474')
 endfunc
 
+func Test_mouse_position()
+  let save_mouse = &mouse
+  set mouse=a
+  new
+  call setline(1, ['line one', 'line two'])
+  call assert_equal([0, 1, 1, 0], getpos('.'))
+  call test_setmouse(1, 5)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 1, 5, 0], getpos('.'))
+  call test_setmouse(2, 20)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 2, 8, 0], getpos('.'))
+  call test_setmouse(5, 1)
+  call feedkeys("\<LeftMouse>", "xt")
+  call assert_equal([0, 2, 1, 0], getpos('.'))
+  bwipe!
+  let &mouse = save_mouse
+endfunc
+
 func Test_user_is_happy()
   smile
   sleep 300m
index bf1a51111807bbd1c93e30ff295545eeef564a76..db100991ab5f31a23d32a84788ff844860b46467 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for encryption.
 
 if !has('cryptv')
-  finish
+  throw 'Skipped, encryption feature missing'
 endif
 
 func Common_head_only(text)
index 7795ac7af264ef0aecbbcc06961be28dd3f65936..a3fcbd77b65bf29f1819296377c23b30787d87ce 100644 (file)
@@ -1,7 +1,10 @@
 " Test for cscope commands.
 
-if !has('cscope') || !executable('cscope') || !has('quickfix')
-  finish
+if !has('cscope') || !has('quickfix')
+  throw 'Skipped, cscope or quickfix feature missing'
+endif
+if !executable('cscope')
+  throw 'Skipped, cscope program missing'
 endif
 
 func CscopeSetupOrClean(setup)
index 8d56a1a247ed3af9ce665aecde2ec2966fffb42a..92d4e479a710ab1272c29f1b4ee9fc0b688a7548 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for digraphs
 
 if !has("digraphs")
-  finish
+  throw 'Skipped, digraphs feature missing'
 endif
 
 func Put_Dig(chars)
index 29bfc9e2d0ae43aa60bb5fabcc0189b46546816c..6340b538f5a0f679f49f99d587d66df788241d80 100644 (file)
@@ -1,7 +1,7 @@
 " test float functions
 
 if !has('float')
-  finish
+  throw 'Skipped, float feature missing'
 end
 
 func Test_abs()
index 5a1763db8dcacb52dd1af8fbc6ec9754a08d1bc5..d030a6ae6ae3f0bb37683722ab1e02e1697a6c10 100644 (file)
@@ -2,7 +2,7 @@
 
 source shared.vim
 if !CanRunGui()
-  finish
+  throw 'Skipped, cannot run GUI'
 endif
 
 source setup_gui.vim
index 638708f4f1e7a0c62da5fb9b9d321b15649942d8..a8eefa56b9aa0492bf571717f478e9bc0874039e 100644 (file)
@@ -3,7 +3,7 @@
 
 source shared.vim
 if !CanRunGui()
-  finish
+  throw 'Skipped, cannot run GUI'
 endif
 
 source setup_gui.vim
index 16aad9889e38b9b879d4cfe423631b77bffc6ada..4b464137bbfc2a1e55879402c72ef16b817e7877 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for the history functions
 
 if !has('cmdline_hist')
-  finish
+  throw 'Skipped, cmdline_hist feature missing'
 endif
 
 set history=7
index 572fad78ba75d678d132e238fe1b4e508b6e7d6f..4b260f8480120d897cc3ed42c699c7fbec8f9a48 100644 (file)
@@ -1,7 +1,7 @@
 " tests for 'langmap'
 
 if !has('langmap')
-  finish
+  throw 'Skipped, langmap feature missing'
 endif
 
 func Test_langmap()
index 29e797dc253bb01c0cba1d1e5f8f9247a1c2a23c..5af4133ec8edde1aa39c36b28083933aa19ca613 100644 (file)
@@ -3,8 +3,11 @@
 set encoding=latin1
 scriptencoding latin1
 
-if !exists("+linebreak") || !has("conceal")
-  finish
+if !exists("+linebreak")
+  throw 'Skipped, linebreak option missing'
+endif
+if !has("conceal")
+  throw 'Skipped, conceal feature missing'
 endif
 
 source view_util.vim
index c38e0c5f3cd364642078a9cf0b6ca88888dc766b..1154d6626bab62816c6139be92cea357fc58b3ad 100644 (file)
@@ -3,8 +3,14 @@
 set encoding=utf-8
 scriptencoding utf-8
 
-if !exists("+linebreak") || !has("conceal") || !has("signs")
-  finish
+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 view_util.vim
index 604cfedd32a582ea1f898a5782c5820981213d77..5d2f088e3f9d8591085032700670607f95d3a1c8 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for Lua.
 
 if !has('lua')
-  finish
+  throw 'Skipped, lua feature missing'
 endif
 
 func TearDown()
index d18b3b6de8169361eea2930acf303cc3fc4dfe63..6de3c706f38d0d16035652a69e260d7af26f3d47 100644 (file)
@@ -4,8 +4,7 @@ source shared.vim
 
 let s:python = PythonProg()
 if s:python == ''
-  " Can't run this test.
-  finish
+  throw 'Skipped, python program missing'
 endif
 
 let s:script = 'test_makeencoding.py'
index 8d774a0005a099ae244e6b1adb617e2c59cdbd52..a7c8b06f539f92eeb46bf42d1a9d8b9cd6d98d11 100644 (file)
@@ -1,6 +1,7 @@
 " Test for matchadd() and conceal feature
+
 if !has('conceal')
-  finish
+  throw 'Skipped, conceal feature missing'
 endif
 
 if !has('gui_running') && has('unix')
index d280c153ac4b3781fa7d6a6bf9dd5f6f62e69ecc..fb275777da42a93499ae18f461742f4d056139c4 100644 (file)
@@ -1,6 +1,7 @@
 " Test for matchadd() and conceal feature using utf-8.
+
 if !has('conceal')
-  finish
+  throw 'Skipped, conceal feature missing'
 endif
 
 if !has('gui_running') && has('unix')
index 8c2f8f7315d9b7171434a36fc9462ac6f56fa6f9..eadd4ea9700721775ba5e32bff878fc15c3edeb0 100644 (file)
@@ -1,9 +1,15 @@
 " Tests for memory usage.
 
-if !has('terminal') || has('gui_running') || $ASAN_OPTIONS !=# ''
+if !has('terminal')
+  throw 'Skipped, terminal feature missing'
+endif
+if has('gui_running')
+  throw 'Skipped, does not work in GUI'
+endif
+if $ASAN_OPTIONS !=# ''
   " Skip tests on Travis CI ASAN build because it's difficult to estimate
   " memory usage.
-  finish
+  throw 'Skipped, does not work with ASAN'
 endif
 
 source shared.vim
@@ -14,7 +20,7 @@ endfunc
 
 if has('win32')
   if !executable('wmic')
-    finish
+    throw 'Skipped, wmic program missing'
   endif
   func s:memory_usage(pid) abort
     let cmd = printf('wmic process where processid=%d get WorkingSetSize', a:pid)
@@ -22,13 +28,13 @@ if has('win32')
   endfunc
 elseif has('unix')
   if !executable('ps')
-    finish
+    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
-  finish
+  throw 'Skipped, not win32 or unix'
 endif
 
 " Wait for memory usage to level off.
index b57fdc3de2fc30416a011f1506c368fe300bef2c..99f888af19dd4086b2b31002af6fb22e80816cf6 100644 (file)
@@ -1,7 +1,7 @@
 " Test that the system menu can be loaded.
 
 if !has('menu')
-  finish
+  throw 'Skipped, menu feature missing'
 endif
 
 func Test_load_menu()
index bc413968b4d4cc340076720b59a19992ab3d10ed..ee2d148c6731019969c2ef0233977392e4b76e6f 100644 (file)
@@ -4,7 +4,7 @@ set encoding=latin1
 scriptencoding latin1
 
 if !has('mksession')
-  finish
+  throw 'Skipped, mksession feature missing'
 endif
 
 source shared.vim
index 36f07512a8234adc46b46ac46428cc09987bbb3d..6bf5823ce8257c45dc5c2ef306e9ee374510efe3 100644 (file)
@@ -4,7 +4,7 @@ set encoding=utf-8
 scriptencoding utf-8
 
 if !has('mksession')
-  finish
+  throw 'Skipped, mksession feature missing'
 endif
 
 func Test_mksession_utf8()
index 66177ada76de205359db51872516a78fc5bcf9ff..836bddff3c18b3635da2df0a880f333bc143defd 100644 (file)
@@ -1,15 +1,14 @@
 " Test the netbeans interface.
 
 if !has('netbeans_intg')
-  finish
+  throw 'Skipped, netbeans_intg feature missing'
 endif
 
 source shared.vim
 
 let s:python = PythonProg()
 if s:python == ''
-  " Can't run this test.
-  finish
+  throw 'Skipped, python program missing'
 endif
 
 " Run "testfunc" after sarting the server and stop the server afterwards.
index 29206b94bcd055923b1ccc3ba0eec5f8885a04df..ee69641538f6ea333cc4192042eff2bde848aa5b 100644 (file)
@@ -1,8 +1,11 @@
 " Tests for bracketed paste and other forms of pasting.
 
 " Bracketed paste only works with "xterm".  Not in GUI or Windows console.
-if has('gui_running') || has('win32')
-  finish
+if has('win32')
+  throw 'Skipped, does not work on MS-Windows'
+endif
+if has('gui_running')
+  throw 'Skipped, does not work in the GUI'
 endif
 set term=xterm
 
@@ -122,7 +125,6 @@ func Test_xrestore()
   if !has('xterm_clipboard')
     return
   endif
-call ch_logfile('logfile', 'w')
   let display = $DISPLAY
   new
   call CheckCopyPaste()
@@ -133,6 +135,5 @@ call ch_logfile('logfile', 'w')
   exe "xrestore " .. display
   call CheckCopyPaste()
 
-call ch_logfile('', '')
   bwipe!
 endfunc
index e24c04f7cef0409a4ae18e28f23e3c12136bc899..d38fc079820ea238b04ba441e994eb584347b96d 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for Perl interface
 
 if !has('perl')
-  finish
+  throw 'Skipped, perl feature missing'
 end
 
 " FIXME: RunTest don't see any error when Perl abort...
index ae47a6d8c305b65594080fc82f5b736c6aa6500e..ddabe3a953623e135e3233d1481ed9ec750d0a36 100644 (file)
@@ -1,6 +1,7 @@
 " Test Vim profiler
+
 if !has('profile')
-  finish
+  throw 'Skipped, profile feature missing'
 endif
 
 func Test_profile_func()
index 1b8a1ec7497c6be468230e61ff3b9bc450ba03f2..5cf65d5135e5cf28b7c15627ceefa74a07740443 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for setting 'buftype' to "prompt"
 
 if !has('channel')
-  finish
+  throw 'Skipped, channel feature missing'
 endif
 
 source shared.vim
index 5703231ed745b4556268523f78801d72b1a0bcb3..5b1085228831d436041529af5dd9f395733f3e69 100644 (file)
@@ -2,7 +2,7 @@
 " TODO: move tests from test87.in here.
 
 if !has('python')
-  finish
+  throw 'Skipped, python feature missing'
 endif
 
 func Test_pydo()
index aacc5a57595f0a209da07238fa2876810416e5a6..e001360e75537c550752098fb55833fb73cfe249 100644 (file)
@@ -2,7 +2,7 @@
 " TODO: move tests from test88.in here.
 
 if !has('python3')
-  finish
+  throw 'Skipped, python3 feature missing'
 endif
 
 func Test_py3do()
index baaf7fa3008af116d1beccc4b48f7ec830a2c278..64bd579c268eaeec76c715a29c3f86cd8dbf5398 100644 (file)
@@ -2,7 +2,7 @@
 
 set pyx=2
 if !has('python')
-  finish
+  throw 'Skipped, python feature missing'
 endif
 
 let s:py2pattern = '^2\.[0-7]\.\d\+'
index 4b6057a8d5362fb72bed09c91c610ddb2805b512..1b7bdae793c56940d7b88d3fa2ddfc19173070d2 100644 (file)
@@ -2,7 +2,7 @@
 
 set pyx=3
 if !has('python3')
-  finish
+  throw 'Skipped, python3 feature missing'
 endif
 
 let s:py2pattern = '^2\.[0-7]\.\d\+'
index ef0a512028abbb6eb09f956a4788edf46f7037e3..2fa28c9947f7b2a5e03af7e855f1071baef36d14 100644 (file)
@@ -1,7 +1,7 @@
 " Test for the quickfix feature.
 
 if !has('quickfix')
-  finish
+  throw 'Skipped, quickfix feature missing'
 endif
 
 set encoding=utf-8
index 1334201a7eeca9c208d8963f8b2ad95232d10f4e..b6dab6b57138e9acc468690a2f4a6f466432c60d 100644 (file)
@@ -2,7 +2,7 @@
 
 source shared.vim
 if !WorkingClipboard()
-  finish
+  throw 'Skipped, no working clipboard'
 endif
 
 source shared.vim
index adabf16c1e8a88302ab804d17a5130909e9bd64f..18765391034ff58e915561eb008af72ef3829af5 100644 (file)
@@ -1,7 +1,10 @@
 " Tests for reltime()
 
-if !has('reltime') || !has('float')
-  finish
+if !has('reltime')
+  throw 'Skipped, reltime feature missing'
+endif
+if !has('float')
+  throw 'Skipped, float feature missing'
 endif
 
 func Test_reltime()
index 3c9df3a058caa0c7fb45f8826cbeacffb060380a..dcfdc62448cae59128b97dd70684f88163d561ec 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for ruby interface
 
 if !has('ruby')
-  finish
+  throw 'Skipped, ruby feature missing'
 end
 
 func Test_ruby_change_buffer()
index dd4707977e7829fbd99eaddee0e7d8e4d908fc3f..7f802b143bbc828b6cac3935f05727dd5e930aa7 100644 (file)
@@ -1,7 +1,10 @@
 " Tests for the sha256() function.
 
-if !has('cryptv') || !exists('*sha256')
-  finish
+if !has('cryptv')
+  throw 'Skipped, cryptv feature missing'
+endif
+if !exists('*sha256')
+  throw 'Skipped, sha256 function missing'
 endif
 
 function Test_sha256()
index f151788cedc0d30574aade4f7d0d33999e3fe8f6..564cd961236870aee1235c720539a709c9af4ca1 100644 (file)
@@ -2,7 +2,7 @@
 " Only for use on Win32 systems!
 
 if !has('win32')
-  finish
+  throw 'Skipped, not on MS-Windows'
 endif
 
 func TestIt(file, bits, expected)
index 5dec1d32b8d3608a064b056fd8fee5fcab38b8e1..365958a387e1bc1a044bde99535eb381759cef6a 100644 (file)
@@ -1,7 +1,7 @@
 " Test signal handling.
 
 if !has('unix')
-  finish
+  throw 'Skipped, not on Unix'
 endif
 
 source shared.vim
index 8a6731cc410b478f64c8a2c1a2bf7e6d955b0352..4a23e4ba1bbc9a2dfa3c931a374eaf71fa736dc7 100644 (file)
@@ -1,7 +1,7 @@
 " Test for signs
 
 if !has('signs')
-  finish
+  throw 'Skipped, signs feature missing'
 endif
 
 func Test_sign()
index b3143c95fd079427e9ff226a98b8b66791ce0ee2..72599fdc138950bf8f7375b99a2a562915de52dc 100644 (file)
@@ -1,7 +1,7 @@
 " Test spell checking
 
 if !has('spell')
-  finish
+  throw 'Skipped, spell feature missing'
 endif
 
 func TearDown()
index bdcef511473d7814cfd8355702ea20631ab44137..8d9d7d35c17cd00559c3035304ba32605cd08be3 100644 (file)
@@ -1,7 +1,7 @@
 " Test for syntax and syntax iskeyword option
 
 if !has("syntax")
-  finish
+  throw 'Skipped, syntax feature missing'
 endif
 
 source view_util.vim
index c0eadc6372735a8aa6ab443a92bfe08efe75ce24..8ccd34c6b6238fd893912b117b6f12872cfdcb5c 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for the Tcl interface.
 
 if !has('tcl')
-  finish
+  throw 'Skipped, tcl feature missing'
 end
 
 " Helper function as there is no builtin tcleval() function similar
index 9cfc6498317c39ee1ec8c12e6def84fb3d816c8f..9d7f6b5fa788582897132606a24ee891d44fdff9 100644 (file)
@@ -1,8 +1,11 @@
 " Tests for decoding escape sequences sent by the terminal.
 
 " This only works for Unix in a terminal
-if has('gui_running') || !has('unix')
-  finish
+if has('gui_running')
+  throw 'Skipped, does not work in the GUI'
+endif
+if !has('unix')
+  throw 'Skipped, not on Unix'
 endif
 
 source shared.vim
index 5fab97510bb024a084a792e35a3161ff96fb3f61..09c050aada259d1b6f0253de249158f339b56e48 100644 (file)
@@ -1,7 +1,7 @@
 " Tests for the terminal window.
 
 if !has('terminal')
-  finish
+  throw 'Skipped, terminal feature missing'
 endif
 
 source shared.vim
index aad4b98cb521f46d1837f9d2d24e8482dbc1ca29..d010c3b8f147cf7dc14b1ebb86b2978efe6519a5 100644 (file)
@@ -3,7 +3,7 @@
 " freed.  Since the process exists right away it's not a real leak.
 
 if !has('terminal')
-  finish
+  throw 'Skipped, terminal feature missing'
 endif
 
 source shared.vim
index 0baabc0438e31c942907075734de201654b2bc03..5366a35fbae1b488006e5a5c1b76e725f04007bd 100644 (file)
@@ -1,7 +1,7 @@
 " Test for textobjects
 
 if !has('textobjects')
-  finish
+  throw 'Skipped, textobjects feature missing'
 endif
 
 func CpoM(line, useM, expected)
index bfd39d5da07fbe7a006b2e18d14493b2ea3e2b4e..cb27f5877c98dcac974c0d82ec2a70e07535f155 100644 (file)
@@ -2,7 +2,7 @@
 " buffer.
 
 if !has('textprop')
-  finish
+  throw 'Skipped, textprop feature missing'
 endif
 
 source screendump.vim
index 963cc23276a525f46f782dc6addc60a037bdda3f..5b09011c7555b4ea2702aeb4cbc236bca1776ee0 100644 (file)
@@ -1,7 +1,7 @@
 " Test for timers
 
 if !has('timers')
-  finish
+  throw 'Skipped, timers feature missing'
 endif
 
 source shared.vim
index df61c0ea6634f4d24dd2aa7990ff323bb15e9bdd..640aa0b305d3223084858b08438619d9dd59e634 100644 (file)
@@ -1,7 +1,7 @@
 " Test for variable tabstops
 
 if !has("vartabs")
-  finish
+  throw 'Skipped, vartabs feature missing'
 endif
 
 source view_util.vim
index c0b43b934e3ce4d91247b0725adeda55a57a316a..51ef0a8633b04293d51c4dbddcf3ebe0c8941bbb 100644 (file)
@@ -1,7 +1,7 @@
 " Test WinBar
 
 if !has('menu')
-  finish
+  throw 'Skipped, menu feature missing'
 endif
 
 source shared.vim
index 2e311b9aa55c9f0bf0cc0eb2162f39cca009dd21..da95ed27c8bef966e7a82091984de248ad97fe9e 100644 (file)
@@ -1,7 +1,7 @@
 " Test for $HOME on Windows.
 
 if !has('win32')
-  finish
+  throw 'Skipped, not on MS-Windows'
 endif
 
 let s:env = {}
index 6b9dd547bd27b847bdc78b9056f710dfeebba638..63ac574abba791782181a3a9ce8b126800a72726 100644 (file)
@@ -2,7 +2,7 @@
 if empty($XXD) && executable('..\xxd\xxd.exe')
   let s:xxd_cmd = '..\xxd\xxd.exe'
 elseif empty($XXD) || !executable($XXD)
-  finish
+  throw 'Skipped, xxd program missing'
 else
   let s:xxd_cmd = $XXD
 endif
index 63eacb0295f755ae4d510289e65961a23081408e..9835fcc7e22190c8a234353731cd9edff2e8843c 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1524,
 /**/
     1523,
 /**/