summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-03-17 12:27:23 +0100
committerBram Moolenaar <Bram@vim.org>2021-03-17 12:27:23 +0100
commitf8c52e8d08de3fdf48db877d7d53d2d68c6ceb7b (patch)
treeff53ccb4df5f66c1cec656f191cf0e665784358d
parent1e448465e1281eeb379f75fe848cbb47fe1be1d9 (diff)
downloadvim-git-f8c52e8d08de3fdf48db877d7d53d2d68c6ceb7b.tar.gz
patch 8.2.2611: conditions for startup tests are not exactly rightv8.2.2611
Problem: Conditions for startup tests are not exactly right. Solution: Check for type of GUI instead of MS-Windows. (Ozaki Kiichi, closes #7976)
-rw-r--r--src/main.c3
-rw-r--r--src/testdir/check.vim25
-rw-r--r--src/testdir/test_startup.vim13
-rw-r--r--src/version.c2
4 files changed, 36 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 76252c7d1..369741aba 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3542,8 +3542,11 @@ usage(void)
#endif // FEAT_GUI_X11
#ifdef FEAT_GUI_GTK
mch_msg(_("\nArguments recognised by gvim (GTK+ version):\n"));
+ main_msg(_("-background <color>\tUse <color> for the background (also: -bg)"));
+ main_msg(_("-foreground <color>\tUse <color> for normal text (also: -fg)"));
main_msg(_("-font <font>\t\tUse <font> for normal text (also: -fn)"));
main_msg(_("-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"));
+ main_msg(_("-iconic\t\tStart Vim iconified"));
main_msg(_("-reverse\t\tUse reverse video (also: -rv)"));
main_msg(_("-display <display>\tRun Vim on <display> (also: --display)"));
main_msg(_("--role <role>\tSet a unique role to identify the main window"));
diff --git a/src/testdir/check.vim b/src/testdir/check.vim
index db16cfb7d..4fe130b7b 100644
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -199,4 +199,29 @@ func CheckNotAsan()
endif
endfunc
+" Command to check for satisfying any of the conditions.
+" e.g. CheckAnyOf Feature:bsd Feature:sun Linux
+command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)
+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(<f-args>)
+func CheckAllOf(...)
+ for arg in a:000
+ exe 'Check' .. substitute(arg, ':', ' ', '')
+ endfor
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 169c21350..17ac94d69 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -109,9 +109,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')
@@ -426,7 +425,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")
@@ -447,7 +446,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)?
@@ -496,7 +495,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(),
@@ -528,7 +527,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')
diff --git a/src/version.c b/src/version.c
index 7b0771e7f..dad20388d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2611,
+/**/
2610,
/**/
2609,