0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 7.4.981

Problem:    An error in a test script goes unnoticed.
Solution:   Source the test script inside try/catch. (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2015-12-28 14:44:10 +01:00
parent 57d7971b5f
commit 4686b323e4
2 changed files with 12 additions and 7 deletions

View File

@@ -21,9 +21,7 @@
" It will be called after each Test_ function. " It will be called after each Test_ function.
" Without the +eval feature we can't run these tests, bail out. " Without the +eval feature we can't run these tests, bail out.
if 0 so small.vim
quit!
endif
" Check that the screen size is at least 24 x 80 characters. " Check that the screen size is at least 24 x 80 characters.
if &lines < 24 || &columns < 80 if &lines < 24 || &columns < 80
@@ -38,7 +36,15 @@ endif
" Source the test script. First grab the file name, in case the script " Source the test script. First grab the file name, in case the script
" navigates away. " navigates away.
let testname = expand('%') let testname = expand('%')
let done = 0
let fail = 0
let errors = []
try
source % source %
catch
let fail += 1
call add(errors, 'Caught exception: ' . v:exception . ' @ ' . v:throwpoint)
endtry
" Locate Test_ functions and execute them. " Locate Test_ functions and execute them.
redir @q redir @q
@@ -46,9 +52,6 @@ function /^Test_
redir END redir END
let tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g')) let tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g'))
let done = 0
let fail = 0
let errors = []
for test in tests for test in tests
if exists("*SetUp") if exists("*SetUp")
call SetUp() call SetUp()

View File

@@ -741,6 +741,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 */
/**/
981,
/**/ /**/
980, 980,
/**/ /**/