forked from aniani/vim
patch 8.2.4879: screendump test may fail when using valgrind
Problem: Screendump test may fail when using valgrind. Solution: Wait longer for the first screendump.
This commit is contained in:
@@ -15,15 +15,18 @@ endif
|
|||||||
|
|
||||||
" Verify that Vim running in terminal buffer "buf" matches the screen dump.
|
" Verify that Vim running in terminal buffer "buf" matches the screen dump.
|
||||||
" "options" is passed to term_dumpwrite().
|
" "options" is passed to term_dumpwrite().
|
||||||
|
" Additionally, the "wait" entry can specify the maximum time to wait for the
|
||||||
|
" screen dump to match in msec (default 1000 msec).
|
||||||
" The file name used is "dumps/{filename}.dump".
|
" The file name used is "dumps/{filename}.dump".
|
||||||
" Optionally an extra argument can be passed which is prepended to the error
|
" Optionally an extra argument can be passed which is prepended to the error
|
||||||
" message. Use this when using the same dump file with different options.
|
" message. Use this when using the same dump file with different options.
|
||||||
" Will wait for up to a second for the screen dump to match.
|
|
||||||
" Returns non-zero when verification fails.
|
" Returns non-zero when verification fails.
|
||||||
func VerifyScreenDump(buf, filename, options, ...)
|
func VerifyScreenDump(buf, filename, options, ...)
|
||||||
let reference = 'dumps/' . a:filename . '.dump'
|
let reference = 'dumps/' . a:filename . '.dump'
|
||||||
let testfile = 'failed/' . a:filename . '.dump'
|
let testfile = 'failed/' . a:filename . '.dump'
|
||||||
|
|
||||||
|
let max_loops = get(a:options, 'wait', 1000) / 10
|
||||||
|
|
||||||
" Starting a terminal to make a screendump is always considered flaky.
|
" Starting a terminal to make a screendump is always considered flaky.
|
||||||
let g:test_is_flaky = 1
|
let g:test_is_flaky = 1
|
||||||
|
|
||||||
@@ -60,7 +63,7 @@ func VerifyScreenDump(buf, filename, options, ...)
|
|||||||
endif
|
endif
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
if i == 100
|
if i == max_loops
|
||||||
" Leave the failed dump around for inspection.
|
" Leave the failed dump around for inspection.
|
||||||
if filereadable(reference)
|
if filereadable(reference)
|
||||||
let msg = 'See dump file difference: call term_dumpdiff("testdir/' .. testfile .. '", "testdir/' .. reference .. '")'
|
let msg = 'See dump file difference: call term_dumpdiff("testdir/' .. testfile .. '", "testdir/' .. reference .. '")'
|
||||||
|
@@ -4552,7 +4552,8 @@ func Test_win_gotoid_in_mapping()
|
|||||||
END
|
END
|
||||||
call writefile(lines, 'Xgotoscript')
|
call writefile(lines, 'Xgotoscript')
|
||||||
let buf = RunVimInTerminal('-S Xgotoscript', #{rows: 15, wait_for_ruler: 0})
|
let buf = RunVimInTerminal('-S Xgotoscript', #{rows: 15, wait_for_ruler: 0})
|
||||||
call VerifyScreenDump(buf, 'Test_win_gotoid_1', {})
|
" wait longer here, since we didn't wait for the ruler
|
||||||
|
call VerifyScreenDump(buf, 'Test_win_gotoid_1', #{wait: 3000})
|
||||||
call term_sendkeys(buf, "3Gvl")
|
call term_sendkeys(buf, "3Gvl")
|
||||||
call VerifyScreenDump(buf, 'Test_win_gotoid_2', {})
|
call VerifyScreenDump(buf, 'Test_win_gotoid_2', {})
|
||||||
|
|
||||||
|
@@ -746,6 +746,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 */
|
||||||
|
/**/
|
||||||
|
4879,
|
||||||
/**/
|
/**/
|
||||||
4878,
|
4878,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user