mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.2321
Problem: When a test is commented out we forget about it. Solution: Let a test throw an exception with "Skipped" and list skipped test functions. (Christian Brabandt)
This commit is contained in:
parent
dda933d06c
commit
dac1947bb3
@ -121,7 +121,7 @@ nolog:
|
|||||||
RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f $(GUI_FLAG) -u unix.vim $(NO_PLUGIN)
|
RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f $(GUI_FLAG) -u unix.vim $(NO_PLUGIN)
|
||||||
|
|
||||||
newtests: newtestssilent
|
newtests: newtestssilent
|
||||||
@/bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then cat messages && cat test.log; fi"
|
@/bin/sh -c "if test -f messages && grep -q 'SKIPPED\|FAILED' messages; then cat messages && if test -f test.log; then cat test.log; fi ; fi"
|
||||||
|
|
||||||
newtestssilent: $(NEW_TESTS)
|
newtestssilent: $(NEW_TESTS)
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ TO ADD A NEW STYLE TEST:
|
|||||||
4) Also add an entry in src/Makefile.
|
4) Also add an entry in src/Makefile.
|
||||||
|
|
||||||
What you can use (see test_assert.vim for an example):
|
What you can use (see test_assert.vim for an example):
|
||||||
- Call assert_equal(), assert_true() and assert_false().
|
- Call assert_equal(), assert_true(), assert_false(), etc.
|
||||||
- Use try/catch to check for exceptions.
|
- Use try/catch to check for exceptions.
|
||||||
- Use alloc_fail() to have memory allocation fail. This makes it possible
|
- Use alloc_fail() to have memory allocation fail. This makes it possible
|
||||||
to check memory allocation failures are handled gracefully. You need to
|
to check memory allocation failures are handled gracefully. You need to
|
||||||
@ -29,6 +29,9 @@ What you can use (see test_assert.vim for an example):
|
|||||||
- Use disable_char_avail_for_testing(1) if char_avail() must return FALSE for
|
- Use disable_char_avail_for_testing(1) if char_avail() must return FALSE for
|
||||||
a while. E.g. to trigger the CursorMovedI autocommand event.
|
a while. E.g. to trigger the CursorMovedI autocommand event.
|
||||||
See test_cursor_func.vim for an example
|
See test_cursor_func.vim for an example
|
||||||
|
- If the bug that is being tested isn't fixed yet, you can throw an exception
|
||||||
|
so that it's clear this still needs work. E.g.:
|
||||||
|
throw "Skipped: Bug with <c-e> and popupmenu not fixed yet"
|
||||||
- See the start of runtest.vim for more help.
|
- See the start of runtest.vim for more help.
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,6 +96,9 @@ function RunTheTest(test)
|
|||||||
let s:done += 1
|
let s:done += 1
|
||||||
try
|
try
|
||||||
exe 'call ' . a:test
|
exe 'call ' . a:test
|
||||||
|
catch /^\cskipped/
|
||||||
|
call add(s:messages, ' Skipped')
|
||||||
|
call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', ''))
|
||||||
catch
|
catch
|
||||||
call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
|
call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
|
||||||
endtry
|
endtry
|
||||||
@ -127,6 +130,7 @@ let s:done = 0
|
|||||||
let s:fail = 0
|
let s:fail = 0
|
||||||
let s:errors = []
|
let s:errors = []
|
||||||
let s:messages = []
|
let s:messages = []
|
||||||
|
let s:skipped = []
|
||||||
if expand('%') =~ 'test_viml.vim'
|
if expand('%') =~ 'test_viml.vim'
|
||||||
" this test has intentional s:errors, don't use try/catch.
|
" this test has intentional s:errors, don't use try/catch.
|
||||||
source %
|
source %
|
||||||
@ -200,7 +204,10 @@ if s:fail > 0
|
|||||||
call extend(s:messages, s:errors)
|
call extend(s:messages, s:errors)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Append messages to "messages"
|
" Add SKIPPED messages
|
||||||
|
call extend(s:messages, s:skipped)
|
||||||
|
|
||||||
|
" Append messages to the file "messages"
|
||||||
split messages
|
split messages
|
||||||
call append(line('$'), '')
|
call append(line('$'), '')
|
||||||
call append(line('$'), 'From ' . g:testname . ':')
|
call append(line('$'), 'From ' . g:testname . ':')
|
||||||
|
@ -16,6 +16,21 @@ func! ListMonths()
|
|||||||
return ''
|
return ''
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func! Test_popup_complete2()
|
||||||
|
" Insert match immediately, if there is only one match
|
||||||
|
" <c-e> Should select a character from the line below
|
||||||
|
" TODO: test disabled because the code change has been reverted.
|
||||||
|
throw "Skipped: Bug with <c-e> and popupmenu not fixed yet"
|
||||||
|
new
|
||||||
|
inoremap <f5> <c-r>=ListMonths()<cr>
|
||||||
|
call append(1, ["December2015"])
|
||||||
|
:1
|
||||||
|
call feedkeys("aD\<f5>\<C-E>\<C-E>\<C-E>\<C-E>\<enter>\<esc>", 'tx')
|
||||||
|
call assert_equal(["December2015", "", "December2015"], getline(1,3))
|
||||||
|
%d
|
||||||
|
bw!
|
||||||
|
endfu
|
||||||
|
|
||||||
func! Test_popup_complete()
|
func! Test_popup_complete()
|
||||||
new
|
new
|
||||||
inoremap <f5> <c-r>=ListMonths()<cr>
|
inoremap <f5> <c-r>=ListMonths()<cr>
|
||||||
@ -168,15 +183,6 @@ func! Test_popup_complete()
|
|||||||
call assert_equal(["December2015", "December2015", ""], getline(1,3))
|
call assert_equal(["December2015", "December2015", ""], getline(1,3))
|
||||||
%d
|
%d
|
||||||
|
|
||||||
" Insert match immediately, if there is only one match
|
|
||||||
" <c-e> Should select a character from the line below
|
|
||||||
" TODO: test disabled because the code change has been reverted.
|
|
||||||
" call append(1, ["December2015"])
|
|
||||||
" :1
|
|
||||||
" call feedkeys("aD\<f5>\<C-E>\<C-E>\<C-E>\<C-E>\<enter>\<esc>", 'tx')
|
|
||||||
" call assert_equal(["December2015", "", "December2015"], getline(1,3))
|
|
||||||
" %d
|
|
||||||
|
|
||||||
" use menuone for 'completeopt'
|
" use menuone for 'completeopt'
|
||||||
" Since for the first <c-y> the menu is still shown, will only select
|
" Since for the first <c-y> the menu is still shown, will only select
|
||||||
" three letters from the line above
|
" three letters from the line above
|
||||||
|
@ -763,6 +763,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 */
|
||||||
|
/**/
|
||||||
|
2321,
|
||||||
/**/
|
/**/
|
||||||
2320,
|
2320,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user