Patch 8.2.4879

7 views
Skip to first unread message

Bram Moolenaar

unread,
May 6, 2022, 6:21:57 AM5/6/22
to vim...@googlegroups.com

Patch 8.2.4879
Problem: Screendump test may fail when using valgrind.
Solution: Wait longer for the first screendump.
Files: src/testdir/test_vim9_builtin.vim, src/testdir/screendump.vim


*** ../vim-8.2.4878/src/testdir/test_vim9_builtin.vim 2022-05-05 13:52:59.416192105 +0100
--- src/testdir/test_vim9_builtin.vim 2022-05-06 11:14:13.593320804 +0100
***************
*** 4552,4558 ****
END
call writefile(lines, 'Xgotoscript')
let buf = RunVimInTerminal('-S Xgotoscript', #{rows: 15, wait_for_ruler: 0})
! call VerifyScreenDump(buf, 'Test_win_gotoid_1', {})
call term_sendkeys(buf, "3Gvl")
call VerifyScreenDump(buf, 'Test_win_gotoid_2', {})

--- 4552,4559 ----
END
call writefile(lines, 'Xgotoscript')
let buf = RunVimInTerminal('-S Xgotoscript', #{rows: 15, wait_for_ruler: 0})
! " 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 VerifyScreenDump(buf, 'Test_win_gotoid_2', {})

*** ../vim-8.2.4878/src/testdir/screendump.vim 2022-02-10 19:51:42.545569904 +0000
--- src/testdir/screendump.vim 2022-05-06 11:18:24.565198800 +0100
***************
*** 15,29 ****

" Verify that Vim running in terminal buffer "buf" matches the screen dump.
" "options" is passed to term_dumpwrite().
" The file name used is "dumps/{filename}.dump".
" 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.
- " Will wait for up to a second for the screen dump to match.
" Returns non-zero when verification fails.
func VerifyScreenDump(buf, filename, options, ...)
let reference = 'dumps/' . a:filename . '.dump'
let testfile = 'failed/' . a:filename . '.dump'

" Starting a terminal to make a screendump is always considered flaky.
let g:test_is_flaky = 1

--- 15,32 ----

" Verify that Vim running in terminal buffer "buf" matches the screen dump.
" "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".
" 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.
" Returns non-zero when verification fails.
func VerifyScreenDump(buf, filename, options, ...)
let reference = 'dumps/' . 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.
let g:test_is_flaky = 1

***************
*** 60,66 ****
endif
break
endif
! if i == 100
" Leave the failed dump around for inspection.
if filereadable(reference)
let msg = 'See dump file difference: call term_dumpdiff("testdir/' .. testfile .. '", "testdir/' .. reference .. '")'
--- 63,69 ----
endif
break
endif
! if i == max_loops
" Leave the failed dump around for inspection.
if filereadable(reference)
let msg = 'See dump file difference: call term_dumpdiff("testdir/' .. testfile .. '", "testdir/' .. reference .. '")'
*** ../vim-8.2.4878/src/version.c 2022-05-06 11:02:01.681901115 +0100
--- src/version.c 2022-05-06 11:20:39.349119884 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4879,
/**/

--
hundred-and-one symptoms of being an internet addict:
110. You actually volunteer to become your employer's webmaster.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages