Skip to content

Commit 5d30ff1

Browse files
committed
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".
1 parent f6d50f1 commit 5d30ff1

22 files changed

Lines changed: 63 additions & 61 deletions

src/testdir/test_balloon.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if !has('gui_running')
99

1010
source screendump.vim
1111
if !CanRunVimInTerminal()
12-
throw 'Skipped: cannot run Vim in a terminal window'
12+
throw 'Skipped: cannot make screendumps'
1313
endif
1414

1515
let s:common_script =<< [CODE]

src/testdir/test_breakindent.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
" It helps to change the tabstop setting and force a redraw (e.g. see
66
" Test_breakindent08())
77
if !exists('+breakindent')
8-
finish
8+
throw 'Skipped: breakindent option not supported'
99
endif
1010

1111
source view_util.vim

src/testdir/test_cdo.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands
22

33
if !has('quickfix')
4-
finish
4+
throw 'Skipped: quickfix feature missing'
55
endif
66

77
" Create the files used by the tests

src/testdir/test_channel.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
" Test for channel functions.
22

33
if !has('channel')
4-
finish
4+
throw 'Skipped: channel feature missing'
55
endif
66

77
source shared.vim
88

99
let s:python = PythonProg()
1010
if s:python == ''
1111
" Can't run this test without Python.
12-
finish
12+
throw 'Skipped: Python command missing'
1313
endif
1414

1515
" Uncomment the next line to see what happens. Output is in

src/testdir/test_clientserver.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Tests for the +clientserver feature.
22

33
if !has('job') || !has('clientserver')
4-
finish
4+
throw 'Skipped: job and/or clientserver feature missing'
55
endif
66

77
source shared.vim

src/testdir/test_conceal.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
" Also see test88.in (should be converted to a test function here).
33

44
if !has('conceal')
5-
finish
5+
throw 'Skipped: conceal feature missing'
66
endif
77

88
source screendump.vim
99
if !CanRunVimInTerminal()
10-
finish
10+
throw 'Skipped: cannot make screendumps'
1111
endif
1212

1313
func Test_conceal_two_windows()

src/testdir/test_debugger.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endfunc
2222
" Debugger tests
2323
func Test_Debugger()
2424
if !CanRunVimInTerminal()
25-
return
25+
throw 'Skipped: cannot run Vim in a terminal window'
2626
endif
2727

2828
" Create a Vim script with some functions

src/testdir/test_diffmode.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ endfunc
748748

749749
func Test_diff_screen()
750750
if !CanRunVimInTerminal() || !has('menu')
751-
return
751+
throw 'Skipped: cannot make screendumps and/or menu feature missing'
752752
endif
753753
" clean up already existing swap files, just in case
754754
call delete('.Xfile1.swp')
@@ -880,7 +880,7 @@ endfunc
880880

881881
func Test_diff_with_cursorline()
882882
if !CanRunVimInTerminal()
883-
return
883+
throw 'Skipped: cannot run Vim in a terminal window'
884884
endif
885885

886886
call writefile([
@@ -907,7 +907,7 @@ endfunc
907907

908908
func Test_diff_of_diff()
909909
if !CanRunVimInTerminal()
910-
return
910+
throw 'Skipped: cannot run Vim in a terminal window'
911911
endif
912912

913913
call writefile([

src/testdir/test_fold.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ endfunc
708708

709709
func Test_folds_with_rnu()
710710
if !CanRunVimInTerminal()
711-
return
711+
throw 'Skipped: cannot make screendumps'
712712
endif
713713

714714
call writefile([

src/testdir/test_highlight.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ endfunc
533533

534534
func Test_cursorline_after_yank()
535535
if !CanRunVimInTerminal()
536-
return
536+
throw 'Skipped: cannot make screendumps'
537537
endif
538538

539539
call writefile([
@@ -555,7 +555,7 @@ endfunc
555555

556556
func Test_cursorline_with_visualmode()
557557
if !CanRunVimInTerminal()
558-
return
558+
throw 'Skipped: cannot make screendumps'
559559
endif
560560

561561
call writefile([
@@ -575,7 +575,7 @@ endfunc
575575

576576
func Test_wincolor()
577577
if !CanRunVimInTerminal()
578-
return
578+
throw 'Skipped: cannot make screendumps'
579579
endif
580580

581581
call writefile([

0 commit comments

Comments
 (0)