1
0
forked from aniani/vim

patch 8.1.1483: skipped tests are not properly listed

Problem:    Skipped tests are not properly listed.
Solution:   Throw a "Skipped" exception instead of using ":finish" or ":return".
This commit is contained in:
Bram Moolenaar
2019-06-06 16:12:12 +02:00
parent f6d50f1da8
commit 5d30ff1964
22 changed files with 63 additions and 61 deletions

View File

@@ -9,7 +9,7 @@ if !has('gui_running')
source screendump.vim source screendump.vim
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
throw 'Skipped: cannot run Vim in a terminal window' throw 'Skipped: cannot make screendumps'
endif endif
let s:common_script =<< [CODE] let s:common_script =<< [CODE]

View File

@@ -5,7 +5,7 @@
" It helps to change the tabstop setting and force a redraw (e.g. see " It helps to change the tabstop setting and force a redraw (e.g. see
" Test_breakindent08()) " Test_breakindent08())
if !exists('+breakindent') if !exists('+breakindent')
finish throw 'Skipped: breakindent option not supported'
endif endif
source view_util.vim source view_util.vim

View File

@@ -1,7 +1,7 @@
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands " Tests for the :cdo, :cfdo, :ldo and :lfdo commands
if !has('quickfix') if !has('quickfix')
finish throw 'Skipped: quickfix feature missing'
endif endif
" Create the files used by the tests " Create the files used by the tests

View File

@@ -1,7 +1,7 @@
" Test for channel functions. " Test for channel functions.
if !has('channel') if !has('channel')
finish throw 'Skipped: channel feature missing'
endif endif
source shared.vim source shared.vim
@@ -9,7 +9,7 @@ source shared.vim
let s:python = PythonProg() let s:python = PythonProg()
if s:python == '' if s:python == ''
" Can't run this test without Python. " Can't run this test without Python.
finish throw 'Skipped: Python command missing'
endif endif
" Uncomment the next line to see what happens. Output is in " Uncomment the next line to see what happens. Output is in

View File

@@ -1,7 +1,7 @@
" Tests for the +clientserver feature. " Tests for the +clientserver feature.
if !has('job') || !has('clientserver') if !has('job') || !has('clientserver')
finish throw 'Skipped: job and/or clientserver feature missing'
endif endif
source shared.vim source shared.vim

View File

@@ -2,12 +2,12 @@
" Also see test88.in (should be converted to a test function here). " Also see test88.in (should be converted to a test function here).
if !has('conceal') if !has('conceal')
finish throw 'Skipped: conceal feature missing'
endif endif
source screendump.vim source screendump.vim
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
finish throw 'Skipped: cannot make screendumps'
endif endif
func Test_conceal_two_windows() func Test_conceal_two_windows()

View File

@@ -22,7 +22,7 @@ endfunc
" Debugger tests " Debugger tests
func Test_Debugger() func Test_Debugger()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
" Create a Vim script with some functions " Create a Vim script with some functions

View File

@@ -748,7 +748,7 @@ endfunc
func Test_diff_screen() func Test_diff_screen()
if !CanRunVimInTerminal() || !has('menu') if !CanRunVimInTerminal() || !has('menu')
return throw 'Skipped: cannot make screendumps and/or menu feature missing'
endif endif
" clean up already existing swap files, just in case " clean up already existing swap files, just in case
call delete('.Xfile1.swp') call delete('.Xfile1.swp')
@@ -880,7 +880,7 @@ endfunc
func Test_diff_with_cursorline() func Test_diff_with_cursorline()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
call writefile([ call writefile([
@@ -907,7 +907,7 @@ endfunc
func Test_diff_of_diff() func Test_diff_of_diff()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
call writefile([ call writefile([

View File

@@ -708,7 +708,7 @@ endfunc
func Test_folds_with_rnu() func Test_folds_with_rnu()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([

View File

@@ -533,7 +533,7 @@ endfunc
func Test_cursorline_after_yank() func Test_cursorline_after_yank()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
@@ -555,7 +555,7 @@ endfunc
func Test_cursorline_with_visualmode() func Test_cursorline_with_visualmode()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
@@ -575,7 +575,7 @@ endfunc
func Test_wincolor() func Test_wincolor()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([

View File

@@ -735,7 +735,7 @@ endfunc
func Test_popup_and_previewwindow_dump() func Test_popup_and_previewwindow_dump()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ 'set previewheight=9', \ 'set previewheight=9',
@@ -797,7 +797,7 @@ endfunc
func Test_popup_position() func Test_popup_position()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ '123456789_123456789_123456789_a', \ '123456789_123456789_123456789_a',
@@ -839,7 +839,7 @@ endfunc
func Test_popup_command() func Test_popup_command()
if !CanRunVimInTerminal() || !has('menu') if !CanRunVimInTerminal() || !has('menu')
return throw 'Skipped: cannot make screendumps and/or menu feature missing'
endif endif
call writefile([ call writefile([

View File

@@ -1,14 +1,14 @@
" Tests for popup windows " Tests for popup windows
if !has('textprop') if !has('textprop')
finish throw 'Skipped: textprop feature missing'
endif endif
source screendump.vim source screendump.vim
func Test_simple_popup() func Test_simple_popup()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ "call setline(1, range(1, 100))", \ "call setline(1, range(1, 100))",
@@ -58,7 +58,7 @@ endfunc
func Test_popup_with_border_and_padding() func Test_popup_with_border_and_padding()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
for iter in range(0, 1) for iter in range(0, 1)
@@ -128,7 +128,7 @@ endfunc
func Test_popup_with_syntax_win_execute() func Test_popup_with_syntax_win_execute()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ "call setline(1, range(1, 100))", \ "call setline(1, range(1, 100))",
@@ -152,7 +152,7 @@ endfunc
func Test_popup_with_syntax_setbufvar() func Test_popup_with_syntax_setbufvar()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
let lines =<< trim END let lines =<< trim END
call setline(1, range(1, 100)) call setline(1, range(1, 100))
@@ -177,7 +177,7 @@ endfunc
func Test_popup_all_corners() func Test_popup_all_corners()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
let lines =<< trim END let lines =<< trim END
call setline(1, repeat([repeat('-', 60)], 15)) call setline(1, repeat([repeat('-', 60)], 15))
@@ -340,7 +340,7 @@ endfunc
func Test_popup_with_wrap() func Test_popup_with_wrap()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
let lines =<< trim END let lines =<< trim END
call setline(1, range(1, 100)) call setline(1, range(1, 100))
@@ -359,7 +359,7 @@ endfunc
func Test_popup_without_wrap() func Test_popup_without_wrap()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
let lines =<< trim END let lines =<< trim END
call setline(1, range(1, 100)) call setline(1, range(1, 100))
@@ -760,7 +760,7 @@ endfunc
func Test_popup_never_behind() func Test_popup_never_behind()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
" +-----------------------------+ " +-----------------------------+
" | | | " | | |

View File

@@ -799,7 +799,7 @@ endfunc
func Test_incsearch_scrolling() func Test_incsearch_scrolling()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call assert_equal(0, &scrolloff) call assert_equal(0, &scrolloff)
call writefile([ call writefile([
@@ -832,7 +832,7 @@ func Test_incsearch_search_dump()
return return
endif endif
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
@@ -887,7 +887,7 @@ func Test_incsearch_substitute_dump()
return return
endif endif
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
@@ -983,7 +983,7 @@ endfunc
func Test_incsearch_with_change() func Test_incsearch_with_change()
if !has('timers') || !exists('+incsearch') || !CanRunVimInTerminal() if !has('timers') || !exists('+incsearch') || !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps and/or timers feature and/or incsearch option missing'
endif endif
call writefile([ call writefile([
@@ -1011,7 +1011,7 @@ func Test_incsearch_sort_dump()
return return
endif endif
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
@@ -1037,7 +1037,7 @@ func Test_incsearch_vimgrep_dump()
return return
endif endif
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',

View File

@@ -659,7 +659,7 @@ endfunc
func Test_start_with_tabs() func Test_start_with_tabs()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
let buf = RunVimInTerminal('-p a b c', {}) let buf = RunVimInTerminal('-p a b c', {})

View File

@@ -63,7 +63,7 @@ endfunc
func Test_detect_ambiwidth() func Test_detect_ambiwidth()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
" Use the title termcap entries to output the escape sequence. " Use the title termcap entries to output the escape sequence.

View File

@@ -536,7 +536,7 @@ endfunc
" Check highlighting for a small piece of C code with a screen dump. " Check highlighting for a small piece of C code with a screen dump.
func Test_syntax_c() func Test_syntax_c()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ '/* comment line at the top */', \ '/* comment line at the top */',

View File

@@ -555,7 +555,7 @@ endfunc
func Test_tabpage_cmdheight() func Test_tabpage_cmdheight()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
throw 'Skipped: only works with terminal' throw 'Skipped: cannot make screendumps'
endif endif
call writefile([ call writefile([
\ 'set laststatus=2', \ 'set laststatus=2',

View File

@@ -3,12 +3,12 @@
" This only works with "iconv". " This only works with "iconv".
if !has('iconv') if !has('iconv')
finish throw 'Skipped: iconv feature missing'
endif endif
source screendump.vim source screendump.vim
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
finish throw 'Skipped: cannot make screendumps'
endif endif
" This Vim is running with 'encoding' "utf-8", the Vim in the terminal is " This Vim is running with 'encoding' "utf-8", the Vim in the terminal is

View File

@@ -1037,7 +1037,7 @@ endfunc
" argument, check that :confirm qall works. " argument, check that :confirm qall works.
func Test_terminal_qall_prompt() func Test_terminal_qall_prompt()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = RunVimInTerminal('', {}) let buf = RunVimInTerminal('', {})
@@ -1098,7 +1098,7 @@ endfunc
func Test_terminal_dumpwrite_composing() func Test_terminal_dumpwrite_composing()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let save_enc = &encoding let save_enc = &encoding
set encoding=utf-8 set encoding=utf-8
@@ -1224,7 +1224,7 @@ endfunc
func Test_terminal_api_drop_newwin() func Test_terminal_api_drop_newwin()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = Api_drop_common('') let buf = Api_drop_common('')
call assert_equal(0, &bin) call assert_equal(0, &bin)
@@ -1237,7 +1237,7 @@ endfunc
func Test_terminal_api_drop_newwin_bin() func Test_terminal_api_drop_newwin_bin()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = Api_drop_common(',{"bin":1}') let buf = Api_drop_common(',{"bin":1}')
call assert_equal(1, &bin) call assert_equal(1, &bin)
@@ -1249,7 +1249,7 @@ endfunc
func Test_terminal_api_drop_newwin_binary() func Test_terminal_api_drop_newwin_binary()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = Api_drop_common(',{"binary":1}') let buf = Api_drop_common(',{"binary":1}')
call assert_equal(1, &bin) call assert_equal(1, &bin)
@@ -1261,7 +1261,7 @@ endfunc
func Test_terminal_api_drop_newwin_nobin() func Test_terminal_api_drop_newwin_nobin()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
set binary set binary
let buf = Api_drop_common(',{"nobin":1}') let buf = Api_drop_common(',{"nobin":1}')
@@ -1275,7 +1275,7 @@ endfunc
func Test_terminal_api_drop_newwin_nobinary() func Test_terminal_api_drop_newwin_nobinary()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
set binary set binary
let buf = Api_drop_common(',{"nobinary":1}') let buf = Api_drop_common(',{"nobinary":1}')
@@ -1289,7 +1289,7 @@ endfunc
func Test_terminal_api_drop_newwin_ff() func Test_terminal_api_drop_newwin_ff()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = Api_drop_common(',{"ff":"dos"}') let buf = Api_drop_common(',{"ff":"dos"}')
call assert_equal("dos", &ff) call assert_equal("dos", &ff)
@@ -1301,7 +1301,7 @@ endfunc
func Test_terminal_api_drop_newwin_fileformat() func Test_terminal_api_drop_newwin_fileformat()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = Api_drop_common(',{"fileformat":"dos"}') let buf = Api_drop_common(',{"fileformat":"dos"}')
call assert_equal("dos", &ff) call assert_equal("dos", &ff)
@@ -1313,7 +1313,7 @@ endfunc
func Test_terminal_api_drop_newwin_enc() func Test_terminal_api_drop_newwin_enc()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = Api_drop_common(',{"enc":"utf-16"}') let buf = Api_drop_common(',{"enc":"utf-16"}')
call assert_equal("utf-16", &fenc) call assert_equal("utf-16", &fenc)
@@ -1325,7 +1325,7 @@ endfunc
func Test_terminal_api_drop_newwin_encoding() func Test_terminal_api_drop_newwin_encoding()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let buf = Api_drop_common(',{"encoding":"utf-16"}') let buf = Api_drop_common(',{"encoding":"utf-16"}')
call assert_equal("utf-16", &fenc) call assert_equal("utf-16", &fenc)
@@ -1337,7 +1337,7 @@ endfunc
func Test_terminal_api_drop_oldwin() func Test_terminal_api_drop_oldwin()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
let firstwinid = win_getid() let firstwinid = win_getid()
split Xtextfile split Xtextfile
@@ -1380,7 +1380,7 @@ endfunc
func Test_terminal_api_call() func Test_terminal_api_call()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
call WriteApiCall('Tapi_TryThis') call WriteApiCall('Tapi_TryThis')
@@ -1397,7 +1397,7 @@ endfunc
func Test_terminal_api_call_fails() func Test_terminal_api_call_fails()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
call WriteApiCall('TryThis') call WriteApiCall('TryThis')
@@ -1423,7 +1423,7 @@ endfunc
func Test_terminal_api_call_fail_delete() func Test_terminal_api_call_fail_delete()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
call WriteApiCall('Tapi_Delete') call WriteApiCall('Tapi_Delete')
@@ -1507,7 +1507,7 @@ endfunc
func Test_terminal_all_ansi_colors() func Test_terminal_all_ansi_colors()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
" Use all the ANSI colors. " Use all the ANSI colors.
@@ -1564,7 +1564,7 @@ endfunc
func Test_terminal_termwinsize_option_fixed() func Test_terminal_termwinsize_option_fixed()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
set termwinsize=6x40 set termwinsize=6x40
let text = [] let text = []
@@ -2030,7 +2030,7 @@ endfunc
func Test_terminal_getwinpos() func Test_terminal_getwinpos()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
" split, go to the bottom-right window " split, go to the bottom-right window

View File

@@ -655,7 +655,7 @@ endfunc
func Test_textprop_screenshot_various() func Test_textprop_screenshot_various()
" The Vim running in the terminal needs to use utf-8. " The Vim running in the terminal needs to use utf-8.
if !CanRunVimInTerminal() || g:orig_encoding != 'utf-8' if !CanRunVimInTerminal() || g:orig_encoding != 'utf-8'
return throw 'Skipped: cannot make screendumps or not using utf-8'
endif endif
call writefile([ call writefile([
\ "call setline(1, [" \ "call setline(1, ["
@@ -750,7 +750,7 @@ endfunc
" screenshot test with Visual block mode operations " screenshot test with Visual block mode operations
func Test_textprop_screenshot_visual() func Test_textprop_screenshot_visual()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot make screendumps'
endif endif
" Delete two columns while text props are three chars wide. " Delete two columns while text props are three chars wide.

View File

@@ -281,7 +281,7 @@ endfunc
func Test_restore_count() func Test_restore_count()
if !CanRunVimInTerminal() if !CanRunVimInTerminal()
return throw 'Skipped: cannot run Vim in a terminal window'
endif endif
" Check that v:count is saved and restored, not changed by a timer. " Check that v:count is saved and restored, not changed by a timer.
call writefile([ call writefile([

View File

@@ -767,6 +767,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1483,
/**/ /**/
1482, 1482,
/**/ /**/