From f1f131d132e983bead9173c5cb75a66447c82902 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 17 Mar 2021 22:00:46 -0400 Subject: [PATCH 1/3] vim-patch:8.2.2609: test disabled on MS-Windows even though it should work Problem: Test disabled on MS-Windows even though it should work. Solution: Restore the condition for skipping the test. (Ken Takata, closes vim/vim#7970) https://github.com/vim/vim/commit/321481299757cdd43baeed33f4c5ba543fdfc7f7 --- src/nvim/testdir/test_startup.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim index eebf85af6f..c49d9fc639 100644 --- a/src/nvim/testdir/test_startup.vim +++ b/src/nvim/testdir/test_startup.vim @@ -111,7 +111,9 @@ func Test_pack_in_rtp_when_plugins_run() endfunc func Test_help_arg() - CheckNotMSWindows + if !has('unix') && has('gui_running') + throw 'Skipped: does not work with gvim on MS-Windows' + endif if RunVim([], [], '--help >Xtestout') let lines = readfile('Xtestout') From 2ae6705f871568682df9bbee840c740698a917fd Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 17 Mar 2021 22:03:42 -0400 Subject: [PATCH 2/3] vim-patch:8.2.2611: conditions for startup tests are not exactly right Problem: Conditions for startup tests are not exactly right. Solution: Check for type of GUI instead of MS-Windows. (Ozaki Kiichi, closes vim/vim#7976) https://github.com/vim/vim/commit/f8c52e8d08de3fdf48db877d7d53d2d68c6ceb7b --- src/nvim/testdir/check.vim | 27 +++++++++++++++++++++++++++ src/nvim/testdir/test_startup.vim | 13 ++++++------- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim index 24d3959f83..7b06e53dd5 100644 --- a/src/nvim/testdir/check.vim +++ b/src/nvim/testdir/check.vim @@ -108,3 +108,30 @@ func CheckNotMSWindows() throw 'Skipped: does not work on MS-Windows' endif endfunc + +" Command to check for satisfying any of the conditions. +" e.g. CheckAnyOf Feature:bsd Feature:sun Linux +command -nargs=+ CheckAnyOf call CheckAnyOf() +func CheckAnyOf(...) + let excp = [] + for arg in a:000 + try + exe 'Check' .. substitute(arg, ':', ' ', '') + return + catch /^Skipped:/ + let excp += [substitute(v:exception, '^Skipped:\s*', '', '')] + endtry + endfor + throw 'Skipped: ' .. join(excp, '; ') +endfunc + +" Command to check for satisfying all of the conditions. +" e.g. CheckAllOf Unix Gui Option:ballooneval +command -nargs=+ CheckAllOf call CheckAllOf() +func CheckAllOf(...) + for arg in a:000 + exe 'Check' .. substitute(arg, ':', ' ', '') + endfor +endfunc + +" vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim index c49d9fc639..4d1ad10c23 100644 --- a/src/nvim/testdir/test_startup.vim +++ b/src/nvim/testdir/test_startup.vim @@ -111,9 +111,8 @@ func Test_pack_in_rtp_when_plugins_run() endfunc func Test_help_arg() - if !has('unix') && has('gui_running') - throw 'Skipped: does not work with gvim on MS-Windows' - endif + " This does not work with a GUI-only binary, such as on MS-Windows. + CheckAnyOf Unix NotGui if RunVim([], [], '--help >Xtestout') let lines = readfile('Xtestout') @@ -429,7 +428,7 @@ endfunction " Test the -reverse and +reverse arguments (for GUI only). func Test_reverse() CheckCanRunGui - CheckNotMSWindows + CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena let after =<< trim [CODE] call writefile([&background], "Xtest_reverse") @@ -450,7 +449,7 @@ endfunc " Test the -background and -foreground arguments (for GUI only). func Test_background_foreground() CheckCanRunGui - CheckNotMSWindows + CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena " Is there a better way to check the effect of -background & -foreground " other than merely looking at &background (dark or light)? @@ -499,7 +498,7 @@ endfunc " Test the -geometry argument (for GUI only). func Test_geometry() CheckCanRunGui - CheckNotMSWindows + CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena if has('gui_motif') || has('gui_athena') " FIXME: With GUI Athena or Motif, the value of getwinposx(), @@ -531,7 +530,7 @@ endfunc " Test the -iconic argument (for GUI only). func Test_iconic() CheckCanRunGui - CheckNotMSWindows + CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena call RunVim([], [], '-f -g -iconic -cq') From bd2ea22a54b875ce66595e10fd9354ad31276801 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 17 Mar 2021 22:23:48 -0400 Subject: [PATCH 3/3] gitignore: src/nvim/testdir/test_result.log PR https://github.com/neovim/neovim/pull/14063 added it by mistake. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6004101cce..670340a519 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,7 @@ compile_commands.json /src/nvim/testdir/del /src/nvim/testdir/test*.out /src/nvim/testdir/test*.res -/src/nvim/testdir/test.log +/src/nvim/testdir/test*.log /src/nvim/testdir/messages /src/nvim/testdir/viminfo /src/nvim/testdir/test.ok