From 73f2286f08caa52537523515c27a3070218fc164 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 24 Jan 2026 09:47:54 +0800 Subject: [PATCH] vim-patch:9.1.1370: CI Tests favor GTK2 over GTK3 Problem: CI Tests favor GTK2 over GTK3 Solution: Install GTK3 dependencies and debug packages for CI workflows, update ASAN suppression list, update required dependency checks for the tests (Drew Vogel) closes: vim/vim#17253 https://github.com/vim/vim/commit/ea67ba718d8af10cb7aa3b91379203f5dd7e50d7 Cherry-pick test_match.vim changes from patch 9.0.0626. Co-authored-by: Drew Vogel --- test/old/testdir/check.vim | 26 +++++++++++++++++++++++ test/old/testdir/runtest.vim | 2 ++ test/old/testdir/test_autocmd.vim | 3 +++ test/old/testdir/test_cmdline.vim | 4 ++++ test/old/testdir/test_conceal.vim | 6 ++++++ test/old/testdir/test_crash.vim | 1 + test/old/testdir/test_cursor_func.vim | 4 ++++ test/old/testdir/test_delete.vim | 1 + test/old/testdir/test_diffmode.vim | 4 ++++ test/old/testdir/test_display.vim | 2 ++ test/old/testdir/test_edit.vim | 1 + test/old/testdir/test_functions.vim | 30 +++++++++++++++------------ test/old/testdir/test_hlsearch.vim | 2 ++ test/old/testdir/test_match.vim | 11 ++++++---- test/old/testdir/test_menu.vim | 1 + test/old/testdir/test_messages.vim | 3 +++ test/old/testdir/test_move.vim | 1 + test/old/testdir/test_put.vim | 2 ++ test/old/testdir/test_search.vim | 1 + test/old/testdir/test_signs.vim | 1 + test/old/testdir/test_startup.vim | 1 + test/old/testdir/test_statusline.vim | 4 ++++ test/old/testdir/test_substitute.vim | 1 + test/old/testdir/test_syntax.vim | 1 + test/old/testdir/test_tabpage.vim | 1 + test/old/testdir/test_undo.vim | 1 + test/old/testdir/test_utf8.vim | 3 +++ 27 files changed, 101 insertions(+), 17 deletions(-) diff --git a/test/old/testdir/check.vim b/test/old/testdir/check.vim index 647e25b214..018e81ab21 100644 --- a/test/old/testdir/check.vim +++ b/test/old/testdir/check.vim @@ -124,13 +124,39 @@ func CheckNotMacM1() endif endfunc +func SetupWindowSizeToForVisualDumps() + " The dumps used as reference in these tests were created with a terminal + " width of 75 columns. The vim window that uses the remainder of the GUI + " window width must be at least 3 columns. In theory this means we need the + " GUI shell to provide 78+ columns. However the GTK3 resize logic is flaky, + " sometimes resulting in X11 Configure events that are narrower than + " expected by a number of pixels equal to 2 column widths. Therefore + " setting 80 columns ensures that the GUI shell can still provide 78+ + " columns. This is very likely papering over a GTK3 resize bug but one that + " has existed for a very long time. Establishing this workaround is meant to + " get the GTK3 code working under CI so that we can focus on removing this + " over the long term. + if &columns != 80 + set columns=80 + endif + " Without resetting lines, some GTK3 resize events can carry over between + " tests, which invalidate assumptions in the scrollbar offset calculations. + if &lines != 25 + set lines=25 + endif +endfunc + " Command to check that making screendumps is supported. " Caller must source screendump.vim command CheckScreendump call CheckScreendump() func CheckScreendump() + let g:check_screendump_called = v:true if !CanRunVimInTerminal() throw 'Skipped: cannot make screendumps' endif + if has('gui_running') + call SetupWindowSizeToForVisualDumps() + endif endfunc " Command to check that we can Run Vim in a terminal window diff --git a/test/old/testdir/runtest.vim b/test/old/testdir/runtest.vim index f606f37f41..d2070868fc 100644 --- a/test/old/testdir/runtest.vim +++ b/test/old/testdir/runtest.vim @@ -643,6 +643,8 @@ for g:testfunc in sort(s:tests) " A test can set g:test_is_flaky to retry running the test. let g:test_is_flaky = 0 + let g:check_screendump_called = v:false + " A test can set g:max_run_nr to change the max retry count. let g:max_run_nr = 5 if has('mac') diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index b3c9a44d15..b110b0f393 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -580,6 +580,7 @@ func Test_WinScrolled_close_curwin() endfunc func Test_WinScrolled_once_only() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -609,6 +610,7 @@ endfunc " Check that WinScrolled is not triggered immediately when defined and there " are split windows. func Test_WinScrolled_not_when_defined() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3015,6 +3017,7 @@ endfunc func Test_autocmd_nested_switch_window() " run this in a separate Vim so that SafeState works CheckRunVimInTerminal + CheckScreendump let lines =<< trim END vim9script diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index 7f9c873e80..fc293510c1 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -2849,6 +2849,7 @@ endfunc " Test for using a popup menu for the command line completion matches " (wildoptions=pum) func Test_wildmenu_pum() + CheckScreendump CheckRunVimInTerminal let commands =<< trim [CODE] @@ -3202,6 +3203,7 @@ func Test_wildmenumode_with_pum() endfunc func Test_wildmenu_with_pum_foldexpr() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -3228,6 +3230,7 @@ endfunc " The popup menu should be positioned correctly over the status line of the " bottom-most window. func Test_wildmenu_pum_from_terminal() + CheckScreendump CheckRunVimInTerminal let python = PythonProg() call CheckPython(python) @@ -3248,6 +3251,7 @@ func Test_wildmenu_pum_from_terminal() endfunc func Test_wildmenu_pum_odd_wildchar() + CheckScreendump CheckRunVimInTerminal " Test odd wildchar interactions with pum. Make sure they behave properly diff --git a/test/old/testdir/test_conceal.vim b/test/old/testdir/test_conceal.vim index 996276ed3f..5448e9a991 100644 --- a/test/old/testdir/test_conceal.vim +++ b/test/old/testdir/test_conceal.vim @@ -563,6 +563,8 @@ endfunc " Test that cursor is drawn at the correct column when it is after end of the " line with 'virtualedit' and concealing. func Run_test_conceal_virtualedit_after_eol(wrap) + CheckScreendump + let code =<< trim eval [CODE] let &wrap = {a:wrap} call setline(1, 'abcdefgh|hidden|ijklmnpop') @@ -595,6 +597,8 @@ endfunc " Same as Run_test_conceal_virtualedit_after_eol(), but with 'rightleft'. func Run_test_conceal_virtualedit_after_eol_rightleft(wrap) + CheckScreendump + let code =<< trim eval [CODE] let &wrap = {a:wrap} call setline(1, 'abcdefgh|hidden|ijklmnpop') @@ -628,6 +632,8 @@ endfunc " Test that cursor position is correct when double-width chars are concealed. func Run_test_conceal_double_width(wrap) + CheckScreendump + let code =<< trim eval [CODE] let &wrap = {a:wrap} call setline(1, ['aaaaa口=口bbbbb口=口ccccc', 'foobar']) diff --git a/test/old/testdir/test_crash.vim b/test/old/testdir/test_crash.vim index 8bdf5b6008..7808cbfba6 100644 --- a/test/old/testdir/test_crash.vim +++ b/test/old/testdir/test_crash.vim @@ -241,6 +241,7 @@ func Test_crash1_3() endfunc func Test_crash2() + CheckScreendump " The following used to crash Vim let opts = #{wait_for_ruler: 0, rows: 20} let args = ' -u NONE -i NONE -n -e -s -S ' diff --git a/test/old/testdir/test_cursor_func.vim b/test/old/testdir/test_cursor_func.vim index 99af0ab359..2554167c82 100644 --- a/test/old/testdir/test_cursor_func.vim +++ b/test/old/testdir/test_cursor_func.vim @@ -90,6 +90,10 @@ func Test_curswant_with_cursorline() endfunc func Test_screenpos() + if has('gui_running') + set lines=25 + set columns=78 + endif rightbelow new rightbelow 20vsplit call setline(1, ["\tsome text", "long wrapping line here", "next line"]) diff --git a/test/old/testdir/test_delete.vim b/test/old/testdir/test_delete.vim index c00b8ca47d..6323f9abbe 100644 --- a/test/old/testdir/test_delete.vim +++ b/test/old/testdir/test_delete.vim @@ -111,6 +111,7 @@ endfunc " This should no longer trigger ml_get errors func Test_delete_ml_get_errors() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END set noshowcmd noruler scrolloff=0 diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim index 2c9066a0c6..2fa88ff1ad 100644 --- a/test/old/testdir/test_diffmode.vim +++ b/test/old/testdir/test_diffmode.vim @@ -951,6 +951,8 @@ endfunc " Verify a screendump with both the internal and external diff. func VerifyBoth(buf, dumpfile, extra) + CheckScreendump + " trailing : for leaving the cursor on the command line for cmd in [":set diffopt=filler" . a:extra . "\:", ":set diffopt+=internal\:"] call term_sendkeys(a:buf, cmd) @@ -970,6 +972,8 @@ endfunc " Verify a screendump with the internal diff only. func VerifyInternal(buf, dumpfile, extra) + CheckScreendump + call term_sendkeys(a:buf, ":diffupdate!\") " trailing : for leaving the cursor on the command line call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\:") diff --git a/test/old/testdir/test_display.vim b/test/old/testdir/test_display.vim index c57093cee9..09f33cb2f2 100644 --- a/test/old/testdir/test_display.vim +++ b/test/old/testdir/test_display.vim @@ -519,6 +519,8 @@ func Test_display_linebreak_breakat() endfunc func Run_Test_display_lastline(euro) + CheckScreendump + let lines =<< trim END call setline(1, ['aaa', 'b'->repeat(200)]) set display=truncate diff --git a/test/old/testdir/test_edit.vim b/test/old/testdir/test_edit.vim index 1fc5cb8741..a1e96b2ed0 100644 --- a/test/old/testdir/test_edit.vim +++ b/test/old/testdir/test_edit.vim @@ -2057,6 +2057,7 @@ endfunc " Test for positioning cursor after CTRL-R expression failed func Test_edit_ctrl_r_failed() + CheckScreendump CheckRunVimInTerminal let buf = RunVimInTerminal('', #{rows: 6, cols: 60}) diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index b67c38349b..cfb15b4889 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -847,18 +847,6 @@ func Test_mode() execute "normal! gR\g@l\" call assert_equal('n-niV', g:current_modes) - " Test statusline updates for overstrike mode - if CanRunVimInTerminal() - let buf = RunVimInTerminal('', {'rows': 12}) - call term_sendkeys(buf, ":set laststatus=2 statusline=%!mode(1)\") - call term_sendkeys(buf, ":") - call TermWait(buf) - call VerifyScreenDump(buf, 'Test_mode_1', {}) - call term_sendkeys(buf, "\") - call TermWait(buf) - call VerifyScreenDump(buf, 'Test_mode_2', {}) - call StopVimInTerminal(buf) - endif if has('terminal') term @@ -876,6 +864,22 @@ func Test_mode() delfunction OperatorFunc endfunc +" Test for the mode() function using Screendump feature +func Test_mode_screendump() + CheckScreendump + + " Test statusline updates for overstrike mode + let buf = RunVimInTerminal('', {'rows': 12}) + call term_sendkeys(buf, ":set laststatus=2 statusline=%!mode(1)\") + call term_sendkeys(buf, ":") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_mode_1', {}) + call term_sendkeys(buf, "\") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_mode_2', {}) + call StopVimInTerminal(buf) +endfunc + " Test for append() func Test_append() enew! @@ -914,7 +918,7 @@ func Test_setline() call setline(3, v:_null_list) call setline(2, ["baz"]) call assert_equal(['bar', 'baz'], getline(1, '$')) - close! + bw! endfunc func Test_getbufvar() diff --git a/test/old/testdir/test_hlsearch.vim b/test/old/testdir/test_hlsearch.vim index fb1695220a..7221feebe6 100644 --- a/test/old/testdir/test_hlsearch.vim +++ b/test/old/testdir/test_hlsearch.vim @@ -68,6 +68,7 @@ func Test_hlsearch_eol_highlight() endfunc func Test_hlsearch_Ctrl_R() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -86,6 +87,7 @@ func Test_hlsearch_Ctrl_R() endfunc func Test_hlsearch_clipboard() + CheckScreendump CheckRunVimInTerminal CheckFeature clipboard_working diff --git a/test/old/testdir/test_match.vim b/test/old/testdir/test_match.vim index ddf032d593..a78aceca60 100644 --- a/test/old/testdir/test_match.vim +++ b/test/old/testdir/test_match.vim @@ -344,6 +344,7 @@ func Test_matchdelete_error() endfunc func Test_matchclear_other_window() + CheckScreendump CheckRunVimInTerminal let buf = OtherWindowCommon() call term_sendkeys(buf, ":call clearmatches(winid)\") @@ -354,6 +355,7 @@ func Test_matchclear_other_window() endfunc func Test_matchadd_other_window() + CheckScreendump CheckRunVimInTerminal let buf = OtherWindowCommon() call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\") @@ -365,6 +367,7 @@ func Test_matchadd_other_window() endfunc func Test_match_in_linebreak() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -372,15 +375,15 @@ func Test_match_in_linebreak() call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1) call matchaddpos('ErrorMsg', [[1, 51]]) END - call writefile(lines, 'XscriptMatchLinebreak') + call writefile(lines, 'XscriptMatchLinebreak', 'D') let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10}) call VerifyScreenDump(buf, 'Test_match_linebreak', {}) call StopVimInTerminal(buf) - call delete('XscriptMatchLinebreak') endfunc func Test_match_with_incsearch() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -388,7 +391,7 @@ func Test_match_with_incsearch() call setline(1, range(20)) call matchaddpos('ErrorMsg', [3]) END - call writefile(lines, 'XmatchWithIncsearch') + call writefile(lines, 'XmatchWithIncsearch', 'D') let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6}) call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {}) @@ -397,7 +400,6 @@ func Test_match_with_incsearch() call term_sendkeys(buf, "\") call StopVimInTerminal(buf) - call delete('XmatchWithIncsearch') endfunc " Test for deleting matches outside of the screen redraw top/bottom lines @@ -421,6 +423,7 @@ func Test_matchdelete_redraw() endfunc func Test_match_tab_with_linebreak() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/test/old/testdir/test_menu.vim b/test/old/testdir/test_menu.vim index 2b09240c80..84972b92df 100644 --- a/test/old/testdir/test_menu.vim +++ b/test/old/testdir/test_menu.vim @@ -640,6 +640,7 @@ endfunc " Test for opening a menu drawn in the cmdline area func Test_popupmenu_cmdline() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/test/old/testdir/test_messages.vim b/test/old/testdir/test_messages.vim index a9374ef741..abe25fbd22 100644 --- a/test/old/testdir/test_messages.vim +++ b/test/old/testdir/test_messages.vim @@ -400,6 +400,7 @@ func Test_message_more_scrollback() endfunc func Test_message_not_cleared_after_mode() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -435,6 +436,7 @@ func Test_message_not_cleared_after_mode() endfunc func Test_mode_cleared_after_silent_message() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -459,6 +461,7 @@ endfunc " Test verbose message before echo command func Test_echo_verbose_system() + CheckScreendump CheckRunVimInTerminal CheckUnix " needs the "seq" command CheckNotMac " the macos TMPDIR is too long for snapshot testing diff --git a/test/old/testdir/test_move.vim b/test/old/testdir/test_move.vim index 40d75d887e..ffa0be0bbd 100644 --- a/test/old/testdir/test_move.vim +++ b/test/old/testdir/test_move.vim @@ -47,6 +47,7 @@ func Test_move() endfunc func Test_move_undo() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/test/old/testdir/test_put.vim b/test/old/testdir/test_put.vim index 26eb7f0eb4..a6a4d68ba6 100644 --- a/test/old/testdir/test_put.vim +++ b/test/old/testdir/test_put.vim @@ -248,6 +248,7 @@ func Test_put_visual_block_mode() endfunc func Test_put_other_window() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -267,6 +268,7 @@ func Test_put_other_window() endfunc func Test_put_in_last_displayed_line() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/test/old/testdir/test_search.vim b/test/old/testdir/test_search.vim index 1e06033101..829c80ee96 100644 --- a/test/old/testdir/test_search.vim +++ b/test/old/testdir/test_search.vim @@ -886,6 +886,7 @@ func Test_incsearch_cmdline_modifier() endfunc func Test_incsearch_scrolling() + CheckScreendump CheckRunVimInTerminal call assert_equal(0, &scrolloff) call writefile([ diff --git a/test/old/testdir/test_signs.vim b/test/old/testdir/test_signs.vim index 3ddfe5ebe6..9769876bf5 100644 --- a/test/old/testdir/test_signs.vim +++ b/test/old/testdir/test_signs.vim @@ -1803,6 +1803,7 @@ endfunc " Test for correct cursor position after the sign column appears or disappears. func Test_sign_cursor_position() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/test/old/testdir/test_startup.vim b/test/old/testdir/test_startup.vim index 5f25f5eba5..6dc1eb64f4 100644 --- a/test/old/testdir/test_startup.vim +++ b/test/old/testdir/test_startup.vim @@ -835,6 +835,7 @@ func Test_issue_3969() endfunc func Test_start_with_tabs() + CheckScreendump CheckRunVimInTerminal let buf = RunVimInTerminal('-p a b c', {}) diff --git a/test/old/testdir/test_statusline.vim b/test/old/testdir/test_statusline.vim index a24c1f9964..ebbc6e5443 100644 --- a/test/old/testdir/test_statusline.vim +++ b/test/old/testdir/test_statusline.vim @@ -16,6 +16,10 @@ func TearDown() endfunc func s:get_statusline() + if has('gui_running') + redraw! + sleep 1m + endif return ScreenLines(&lines - 1, &columns)[0] endfunc diff --git a/test/old/testdir/test_substitute.vim b/test/old/testdir/test_substitute.vim index 90c46abe8b..27c6a6ccf9 100644 --- a/test/old/testdir/test_substitute.vim +++ b/test/old/testdir/test_substitute.vim @@ -728,6 +728,7 @@ func Test_sub_cmd_9() endfunc func Test_sub_highlight_zero_match() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END diff --git a/test/old/testdir/test_syntax.vim b/test/old/testdir/test_syntax.vim index 6db5d3c04d..45be057c89 100644 --- a/test/old/testdir/test_syntax.vim +++ b/test/old/testdir/test_syntax.vim @@ -632,6 +632,7 @@ endfunc " Check highlighting for a small piece of C code with a screen dump. func Test_syntax_c() + CheckScreendump CheckRunVimInTerminal call writefile([ \ '/* comment line at the top */', diff --git a/test/old/testdir/test_tabpage.vim b/test/old/testdir/test_tabpage.vim index 482da2de7f..83791b69ba 100644 --- a/test/old/testdir/test_tabpage.vim +++ b/test/old/testdir/test_tabpage.vim @@ -688,6 +688,7 @@ func Test_tabs() endfunc func Test_tabpage_cmdheight() + CheckScreendump CheckRunVimInTerminal call writefile([ \ 'set laststatus=2', diff --git a/test/old/testdir/test_undo.vim b/test/old/testdir/test_undo.vim index 68a2fc7857..fe3d5f8209 100644 --- a/test/old/testdir/test_undo.vim +++ b/test/old/testdir/test_undo.vim @@ -847,6 +847,7 @@ func Test_undo_mark() endfunc func Test_undo_after_write() + CheckScreendump " use a terminal to make undo work like when text is typed CheckRunVimInTerminal diff --git a/test/old/testdir/test_utf8.vim b/test/old/testdir/test_utf8.vim index 5cac4066ea..b4a7d6178a 100644 --- a/test/old/testdir/test_utf8.vim +++ b/test/old/testdir/test_utf8.vim @@ -294,6 +294,7 @@ func Test_getcellwidths() endfunc func Test_setcellwidths_dump() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -311,6 +312,7 @@ endfunc " Test setcellwidths() on characters that are not targets of 'ambiwidth'. func Test_setcellwidths_with_non_ambiwidth_character_dump() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END @@ -333,6 +335,7 @@ endfunc " For some reason this test causes Test_customlist_completion() to fail on CI, " so run it as the last test. func Test_zz_ambiwidth_hl_dump() + CheckScreendump CheckRunVimInTerminal let lines =<< trim END