2016-02-03 22:22 GMT+03:00 Bram Moolenaar <[email protected]>:
>
> Patch 7.4.1248
> Problem:    Can't reliably stop the channel test server.  Can't start the
>             server if the python file is not executable.
> Solution:   Use "pkill" instead of "killall".  Run the python file as an
>             argument instead of as an executable.
> Files:      src/testdir/test_channel.vim
>
>
> *** ../vim-7.4.1247/src/testdir/test_channel.vim        2016-02-03 
> 20:13:19.721014093 +0100
> --- src/testdir/test_channel.vim        2016-02-03 20:21:17.084013936 +0100
> ***************
> *** 4,10 ****
>   " This requires the Python command to run the test server.
>   " This most likely only works on Unix and Windows console.
>   if has('unix')
> !   if !executable('python')
>       finish
>     endif
>   elseif has('win32') && !has('gui_win32')
> --- 4,11 ----
>   " This requires the Python command to run the test server.
>   " This most likely only works on Unix and Windows console.
>   if has('unix')
> !   " We also need the pkill command to make sure the server can be stopped.
> !   if !executable('python') || !executable('pkill')
>       finish
>     endif
>   elseif has('win32') && !has('gui_win32')
> ***************
> *** 20,26 ****
>     if has('win32')
>       silent !start cmd /c start "test_channel" py test_channel.py
>     else
> !     silent !./test_channel.py&
>     endif
>   endfunc
>
> --- 21,27 ----
>     if has('win32')
>       silent !start cmd /c start "test_channel" py test_channel.py
>     else
> !     silent !python test_channel.py&
>     endif
>   endfunc
>
> ***************
> *** 28,34 ****
>     if has('win32')
>       call system('taskkill /IM py.exe /T /F /FI "WINDOWTITLE eq 
> test_channel"')
>     else
> !     call system("killall test_channel.py")
>     endif
>   endfunc
>
> --- 29,35 ----
>     if has('win32')
>       call system('taskkill /IM py.exe /T /F /FI "WINDOWTITLE eq 
> test_channel"')
>     else
> !     call system("pkill --full test_channel.py")

Now if I edit test_channel.py by starting a editor like `vim
test_channel.py` I will get it killed when running the tests. Hanging
process is *much* better, but I would simply suggest to use Python to
run this specific test and let it handle everything: starting Vim,
starting test_channel.py, killing test_channel.py when Vim exits.
subprocess.Popen.kill is more portable and is not going to kill
something unexpected and to run this test you already need Python.

>     endif
>   endfunc
>
> *** ../vim-7.4.1247/src/version.c       2016-02-03 20:13:19.725014051 +0100
> --- src/version.c       2016-02-03 20:20:11.436701535 +0100
> ***************
> *** 744,745 ****
> --- 744,747 ----
>   {   /* Add new patch number below this line */
> + /**/
> +     1248,
>   /**/
>
> --
> hundred-and-one symptoms of being an internet addict:
> 120. You ask a friend, "What's that big shiny thing?" He says, "It's the sun."
>
>  /// 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.

-- 
-- 
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.
  • Patch 7.4.1248 Bram Moolenaar
    • Re: Patch 7.4.1248 Nikolay Aleksandrovich Pavlov

Raspunde prin e-mail lui