2017-03-19 23:59 GMT+09:00 Bram Moolenaar <[email protected]>:

>
> Kazunobu Kuriyama wrote:
>
> > > > > > > > The tests are done with the help of one or more command-line
> > > > > utilities
> > > > > > > > handling the system clipboard.  More specifically, xsel(1)
> for
> > > X11,
> > > > > or
> > > > > > > > pbcopy(1) and pbpaste(1) for macOS.
> > > > > > > >
> > > > > > > > The idea is very similar to the +-register tests I proposed
> > > recently;
> > > > > > > > exchanging a piece of text between vim and the utility, and
> > > > > comparing the
> > > > > > > > result with the expected value in order to check if the
> > > *-register
> > > > > works
> > > > > > > as
> > > > > > > > a faithful mediator between them.
> > > > > > > >
> > > > > > > > pbcopy and pbpaste are installed on macOS by default, but
> I'm not
> > > > > sure if
> > > > > > > > so is xsel.  Hence, please make sure whether or not xsel  is
> > > > > installed on
> > > > > > > > the host system before running the tests against the X11
> > > clipboard
> > > > > (the
> > > > > > > > PRIMARY selection, actually).  When xsel is not found, the
> tests
> > > are
> > > > > > > > skipped leaving a message indicating that.
> > > > > > > >
> > > > > > > > I chose xsel simply because its source code was easily
> available
> > > to
> > > > > me
> > > > > > > and
> > > > > > > > was easily built and installed successfully on my macOS.
> > > > > > > >
> > > > > > > > So, in case xsel is not available to you, please consider
> > > replacing
> > > > > it
> > > > > > > with
> > > > > > > > another utility having the same functionality, or adding a
> test
> > > path
> > > > > > > using
> > > > > > > > that replacement, as the tests themselves are quite simple.
> > > > > > > >
> > > > > > > > Hopefully,  the X11 of Travis CI tests has xsel.
> > > > > > >
> > > > > > > On my system I don't have xsel.  I'm afraid that this probably
> > > means
> > > > > > > that most people don't have it.
> > > > > > >
> > > > > > > How about using another Vim to communicate with?  It's
> possible to
> > > > > > > control it with the client-server feature.
> > > > > >
> > > > > > Oh my...  That reminds us of that file of the worst coverage.
> > > > > >
> > > > > > > For Mac your solution is probably OK.  I don't think
> client-server
> > > > > works
> > > > > > > on Mac.
> > > > > >
> > > > > > Well, by default, you're right.  But after XQuartz is installed,
> > > > >
> > > > > I assume most people won't have it.  I dislike having to install
> all
> > > > > kind of packages to be able to build and test Vim.
> > > > >
> > > > > > ./configure --disable-darwin --disable-gui && make
> > > > > >
> > > > > > detects the X11 there automatically, and builds a vim having
> > > > > +clientserver
> > > > > > (The --disable-gui option is not essential, actually).
> > > > > >
> > > > > > With the vim which was built like that way, do
> > > > > >
> > > > > > ./vim --servername FOOBAR
> > > > > >
> > > > > > on a terminal.  Then, on another terminal,
> > > > > >
> > > > > > ./vim --servername FOOBAR --remote if_xcmdsrv.c
> > > > > >
> > > > > > makes the first vim instance open the file given to it.
> > > > > >
> > > > > > So...looks like you have had me open up a can of worms twice this
> > > week,
> > > > > > haven't you?...wait...It's me who triggered them.  How stupid I
> was!
> > > :)
> > > > >
> > > > > I'll see if I can make a test for the client-server feature.  Will
> be
> > > > > useful.
> > > >
> > > > Indeed.  It's not only useful but also helpful to me.  Rather, I
> should
> > > say
> > > > it's almost a solution. :)
> > >
> > > Done now.  Also found and fixed a problem with remote_peek() on
> > > MS-Windows.
> > >
> > > > Attached is an updated version of test_quotestar.vim.   It uses the
> > > > client-server and job features.  For the case where either of the
> > > features
> > > > is not built in vim, I added a branch for testing such an instance.
> But
> > > > the test of that branch is slow and flaky in comparison with the test
> > > based
> > > > on the client-server and job features, and only proves the
> superiority of
> > > > the latter.
> > >
> > > I would suggest to remove the flaky fall-back test.  Testing it when
> the
> > > features are available should be sufficient.
> > >
> >
> > Done.
> >
> >
> > >
> > > > If the client-server test is expected to be improved further in
> hours or
> > > > days, I'm ready for updating the patch accordingly.
> > >
> > > Have a look if you can use the latest changes.
> > >
> >
> > The attached patch reflects the changes in 8.0.0477 and complies with
> > 8.0.0478.
>
> Thanks.  On my Ubuntu system it fails:
>
> Found errors in Test_quotestar():
> function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11
> line 43: Expected 'yes' but got ''
>
> I added a WaitFor() call, but that didn't help.
> If I run the commands manually it works fine.
>
> Can you reproduce this problem?


No, I can't.  Since XFlush() returns immediately after it flushes the
request queue but does not wait for the X server's processing the flushed
events, it's possible for the content of the PRIMARY selection not to be
changed to 'yes' when the :call assert_equal() at line 43 is called.


>   If not then I'll have to do a bit of
> debugging...
>

So, would you do that?  I do think it's worth a try.

BTW, I attached two patches to this email. One is an update of
test_quotestar.vim.  I added to that a branch which makes the server launch
the GUI when possible, following the test_clientserver.vim.   Another is a
fix for test_clientserver.vim to avoid a hangup due to E285 error for the
Athena and Motif GUIs.

>
> --
> hundred-and-one symptoms of being an internet addict:
> 163. You go outside for the fresh air (at -30 degrees) but open the
>      window first to hear new mail arrive.
>
>  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net
>  \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org
> ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org
> ///
>

-- 
-- 
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.

Attachment: avoid-hangup-due-to-E285.patch
Description: Binary data

Attachment: quotestar-tests-using-clientserver-update02.patch
Description: Binary data

Raspunde prin e-mail lui