On 12/5/2015 1:47 PM, Bram Moolenaar wrote:
Michael Soyka wrote:

On 12/4/2015 5:27 PM, Bram Moolenaar wrote:
Michael Soyka wrote:

On 12/3/2015 4:13 PM, Bram Moolenaar wrote:
I have added "new style" testing for Unix.  It appears to work well, so
now we also need this for other platforms.  The Unix Makefile only
needed a few extra lines, hopefully it's also simple for others.

I would prefer someone who knows the platform to make a patch for this.
We need this for:
        src/testdir/Make_dos.mak
           src/testdir/Make_ming.mak

And if someone still has one of these systems:
        src/testdir/Make_amiga.mak
        src/testdir/Make_os2.mak
           src/testdir/Make_vms.mms

Bram,

Since I've been dabbling in things ming lately, I'm willing to give it
shot.  What information do I need?
Look in src/testdir/Makefile for how "newtests" is defined.
I assume that the MingW make works pretty much like the Unix one.

Bram,

I've updated the mingw makefile using your changes to the unix makefile
as a guide.  I've attached the complete modified file and show the diffs
below.
Nice, thanks.

I ran the newtests using gvim and both tests passed.  However, a popup
window with an OK button is displayed at the conclusion of each test.
This happens whether the test passes or fails.  The tester must press
the OK button to continue to the next test.  Is this desirable?  By the
way, the popup looks like one put up by the confirm function.
There should be no popup window.  Please find a way to avoid it.
I could not reproduce this on Linux when testing with gvim.

Because of the popups, I've added an if-test at the end of the makefile
to display the test status in the terminal window.

I added the "newtests" targets to all the test targets in the makefile-
gui, nongui, and the others.  In effect, I've made the assumption that
the new tests will never be intended for gvim testing exclusively.  If
this is not correct, changes are in order.
The tests should run together with the "old" tests.

Just to be clear, I'm using mingw under Windows.

Thanks for the opportunity to help,
Thanks for looking into this!

Bram, et al,

Here are my thoughts regarding the popup windows I see when running your newtests. The explanation is pure guesswork on my part as I am certainly not familiar with the mysterious ways of Windows. Perhaps someone more knowledgeable can comment.

First of all, what is displayed in the popups are informational messages, some of which come from "redir", "split" and "write" ex-commands. I can make them go away by prefixing the commands with "silent" or, in the case of redir, putting them in a function and calling it with the silent prefix as recommended by the docs. For the "test_assert.vim" test, the popup window will no longer appear if I do all of the above and remove the final test summary message echoed at the end of runtest.vim.

I'm going to conjecture that these popup windows are created because gvim has not yet created a window in which those messages would be displayed. The docs say that "-u" options are processed before gui initializations and before the gui opens any windows and the newtests are run as part of the -u option processing. I understand that the unix behavior contradicts this guess...

By the way, if I launch gvim with a -V option, say -V9, a similar popup window is displayed in which the early verbose messages appear. Subsequent verbose messages show-up in the desktop window.

I think I've gone as far as I can unless someone can make a suggestion.

Mike

For clarity, here's how I modified runtest.vim to eliminate the popup for test_asset.vim:

diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 0dc142e..82ce25e 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -40,9 +40,13 @@ endif
 let testname = expand('%')
 source %

+function SilencedRedir()
+function /^Test_
+endfunction
+
 " Locate Test_ functions and execute them.
 redir @q
-function /^Test_
+silent call SilencedRedir()
 redir END
 let tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g'))

@@ -76,8 +80,8 @@ endfor

 if fail == 0
   " Success, create the .res file so that make knows it's done.
-  exe 'split ' . fnamemodify(testname, ':r') . '.res'
-  write
+  silent exe 'split ' . fnamemodify(testname, ':r') . '.res'
+  silent write
 endif

 if len(errors) > 0
@@ -89,7 +93,7 @@ if len(errors) > 0
   write
 endif

-echo 'Executed ' . done . (done > 1 ? ' tests': ' test')
+"echo 'Executed ' . done . (done > 1 ? ' tests': ' test')
 if fail > 0
   echo fail . ' FAILED'
 endif

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui