From 877e95779869c5426102aa491f67d99904c8534c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2016 20:05:50 +0200 Subject: [PATCH 1/4] patch 7.4.2153 Problem: GUI test isn't testing much. Solution: Turn into a new style test. Execute a shell command. --- src/Makefile | 3 ++- src/testdir/Make_all.mak | 3 ++- src/testdir/Make_vms.mms | 4 ++-- src/testdir/test16.in | 16 ---------------- src/testdir/test16.ok | 2 -- src/testdir/test_gui.vim | 28 ++++++++++++++++++++++++++++ src/version.c | 2 ++ 7 files changed, 36 insertions(+), 22 deletions(-) delete mode 100644 src/testdir/test16.in delete mode 100644 src/testdir/test16.ok create mode 100644 src/testdir/test_gui.vim diff --git a/src/Makefile b/src/Makefile index 6d49e9046b..273fc9ea99 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2039,7 +2039,7 @@ test1 \ test_wordcount \ test_writefile \ test2 test3 test4 test5 test6 test7 test8 test9 \ - test11 test12 test13 test14 test15 test16 test17 test18 test19 \ + test11 test12 test13 test14 test15 test17 test18 test19 \ test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \ test30 test31 test32 test33 test34 test36 test37 test38 test39 \ test40 test41 test42 test43 test44 test45 test46 test48 test49 \ @@ -2080,6 +2080,7 @@ test_arglist \ test_glob2regpat \ test_gn \ test_goto \ + test_gui \ test_hardcopy \ test_help_tagjump \ test_history \ diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 2965b708d0..9493ccb40e 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -154,7 +154,7 @@ SCRIPTS_WIN32 = test50.out # Tests for the GUI. -SCRIPTS_GUI = test16.out +SCRIPTS_GUI = # Tests using runtest.vim.vim. @@ -171,6 +171,7 @@ NEW_TESTS = test_arglist.res \ test_digraph.res \ test_farsi.res \ test_gn.res \ + test_gui.res \ test_hardcopy.res \ test_history.res \ test_increment.res \ diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index ca4fceebd6..5ce32aaa14 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2016 Feb 25 +# Last change: 2016 Aug 04 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -104,7 +104,7 @@ SCRIPT = $(SCRIPTS_ALL) $(SCRIPTS_MORE3) # On ODS-2 tests fail. .IFDEF WANT_GUI -SCRIPT_GUI = test16.out +SCRIPT_GUI = GUI_OPTION = -g .ENDIF diff --git a/src/testdir/test16.in b/src/testdir/test16.in deleted file mode 100644 index 760ac675cd..0000000000 --- a/src/testdir/test16.in +++ /dev/null @@ -1,16 +0,0 @@ -Tests for resetting "secure" flag after GUI has started. -For KDE set a font, empty 'guifont' may cause a hang. - -STARTTEST -:so small.vim -:if $DISPLAY == "" | e! test.ok | wq! test.out | endif -:set exrc secure -:if has("gui_kde") -: set guifont=Courier\ 10\ Pitch/8/-1/5/50/0/0/0/0/0 -:endif -:gui -f -:.,$w! test.out -:qa! -ENDTEST - - just some text diff --git a/src/testdir/test16.ok b/src/testdir/test16.ok deleted file mode 100644 index 25e2eea5c0..0000000000 --- a/src/testdir/test16.ok +++ /dev/null @@ -1,2 +0,0 @@ - - just some text diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim new file mode 100644 index 0000000000..cd698e37af --- /dev/null +++ b/src/testdir/test_gui.vim @@ -0,0 +1,28 @@ +" Tests specifically for the GUI + +if !has('gui') || ($DISPLAY == "" && !has('gui_running')) + finish +endif + +" For KDE set a font, empty 'guifont' may cause a hang. +func SetUp() + if has("gui_kde") + set guifont=Courier\ 10\ Pitch/8/-1/5/50/0/0/0/0/0 + endif +endfunc + +" Test for resetting "secure" flag after GUI has started. +" Must be run first. +func Test_1_set_secure() + set exrc secure + gui -f + call assert_equal(1, has('gui_running')) +endfunc + +func Test_shell_command() + new + r !echo 'hello' + call assert_equal('hello', getline(2)) + bwipe! + call assert_true(1, match(execute('winpos'), 'Window position: X \d\+, Y \d\+') >= 0) +endfunc diff --git a/src/version.c b/src/version.c index e69b355c58..992b374d62 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2153, /**/ 2152, /**/ From fe9489233c463dd87046df3fd95332e47b66e93c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2016 21:11:32 +0200 Subject: [PATCH 2/4] patch 7.4.2154 Problem: Test_communicate() fails sometimes. Solution: Add it to the flaky tests. --- src/testdir/runtest.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index d7c0516803..8f0c0c3c80 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -131,7 +131,7 @@ else endif " Names of flaky tests. -let s:flaky = ['Test_reltime()', 'Test_nb_basic()'] +let s:flaky = ['Test_reltime()', 'Test_nb_basic()', 'Test_communicate()'] " Locate Test_ functions and execute them. set nomore diff --git a/src/version.c b/src/version.c index 992b374d62..c99fff65d3 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2154, /**/ 2153, /**/ From 9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2016 21:21:13 +0200 Subject: [PATCH 3/4] patch 7.4.2155 Problem: Quotes make GUI test fail on MS-Windows. Solution: Remove quotes, strip white space. --- src/testdir/test_gui.vim | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index cd698e37af..d56015cea3 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -21,8 +21,8 @@ endfunc func Test_shell_command() new - r !echo 'hello' - call assert_equal('hello', getline(2)) + r !echo hello + call assert_equal('hello', substitute(getline(2), '\W', '', 'g')) bwipe! call assert_true(1, match(execute('winpos'), 'Window position: X \d\+, Y \d\+') >= 0) endfunc diff --git a/src/version.c b/src/version.c index c99fff65d3..a4392eb1ea 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2155, /**/ 2154, /**/ From c90f2aedd0a5dc2cc75bc9b5f475f8a3e3fe36b1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2016 22:00:15 +0200 Subject: [PATCH 4/4] patch 7.4.2156 Problem: Compiler warning. Solution: Add type cast. (Ken Takata, Mike Williams) --- src/os_win32.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/os_win32.c b/src/os_win32.c index 9fe43218d2..d502634e3e 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -577,7 +577,7 @@ null_libintl_ngettext( const char *msgid_plural, unsigned long n) { - return n == 1 ? msgid : msgid_plural; + return (char *)(n == 1 ? msgid : msgid_plural); } /*ARGSUSED*/ diff --git a/src/version.c b/src/version.c index a4392eb1ea..17febd0562 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2156, /**/ 2155, /**/