mirror of
https://github.com/neovim/neovim.git
synced 2026-04-01 05:12:02 +00:00
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
ea67ba718d
Cherry-pick test_match.vim changes from patch 9.0.0626.
Co-authored-by: Drew Vogel <dvogel@github>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'])
|
||||
|
||||
@@ -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 '
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 . "\<CR>:", ":set diffopt+=internal\<CR>:"]
|
||||
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!\<CR>")
|
||||
" trailing : for leaving the cursor on the command line
|
||||
call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -847,18 +847,6 @@ func Test_mode()
|
||||
execute "normal! gR\<C-o>g@l\<Esc>"
|
||||
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)\<CR>")
|
||||
call term_sendkeys(buf, ":")
|
||||
call TermWait(buf)
|
||||
call VerifyScreenDump(buf, 'Test_mode_1', {})
|
||||
call term_sendkeys(buf, "\<Insert>")
|
||||
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)\<CR>")
|
||||
call term_sendkeys(buf, ":")
|
||||
call TermWait(buf)
|
||||
call VerifyScreenDump(buf, 'Test_mode_1', {})
|
||||
call term_sendkeys(buf, "\<Insert>")
|
||||
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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)\<CR>")
|
||||
@@ -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})\<CR>")
|
||||
@@ -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, "\<CR>")
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -47,6 +47,7 @@ func Test_move()
|
||||
endfunc
|
||||
|
||||
func Test_move_undo()
|
||||
CheckScreendump
|
||||
CheckRunVimInTerminal
|
||||
|
||||
let lines =<< trim END
|
||||
|
||||
@@ -248,6 +248,7 @@ func Test_put_visual_block_mode()
|
||||
bwipe!
|
||||
set ve=
|
||||
endfunc
|
||||
|
||||
func Test_put_other_window()
|
||||
CheckScreendump
|
||||
CheckRunVimInTerminal
|
||||
@@ -267,6 +268,7 @@ func Test_put_other_window()
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Test_put_in_last_displayed_line()
|
||||
CheckScreendump
|
||||
CheckRunVimInTerminal
|
||||
|
||||
@@ -886,6 +886,7 @@ func Test_incsearch_cmdline_modifier()
|
||||
endfunc
|
||||
|
||||
func Test_incsearch_scrolling()
|
||||
CheckScreendump
|
||||
CheckRunVimInTerminal
|
||||
call assert_equal(0, &scrolloff)
|
||||
call writefile([
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -835,6 +835,7 @@ func Test_issue_3969()
|
||||
endfunc
|
||||
|
||||
func Test_start_with_tabs()
|
||||
CheckScreendump
|
||||
CheckRunVimInTerminal
|
||||
|
||||
let buf = RunVimInTerminal('-p a b c', {})
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -728,6 +728,7 @@ func Test_sub_cmd_9()
|
||||
endfunc
|
||||
|
||||
func Test_sub_highlight_zero_match()
|
||||
CheckScreendump
|
||||
CheckRunVimInTerminal
|
||||
|
||||
let lines =<< trim END
|
||||
|
||||
@@ -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 */',
|
||||
|
||||
@@ -688,6 +688,7 @@ func Test_tabs()
|
||||
endfunc
|
||||
|
||||
func Test_tabpage_cmdheight()
|
||||
CheckScreendump
|
||||
CheckRunVimInTerminal
|
||||
call writefile([
|
||||
\ 'set laststatus=2',
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user