0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

patch 7.4.1247

Problem:    The channel test doesn't run on MS-Windows.
Solution:   Make it work on the MS-Windows console. (Ken Takata)
This commit is contained in:
Bram Moolenaar 2016-02-03 20:13:24 +01:00
parent 7c764f7bbf
commit a0f9cd148e
3 changed files with 33 additions and 11 deletions

View File

@ -7,12 +7,6 @@
# Then Vim can send requests to the server: # Then Vim can send requests to the server:
# :let response = ch_sendexpr(handle, 'hello!') # :let response = ch_sendexpr(handle, 'hello!')
# #
# And you can control Vim by typing a JSON message here, e.g.:
# ["ex","echo 'hi there'"]
#
# There is no prompt, just type a line and press Enter.
# To exit cleanly type "quit<Enter>".
#
# See ":help channel-demo" in Vim. # See ":help channel-demo" in Vim.
# #
# This requires Python 2.6 or later. # This requires Python 2.6 or later.

View File

@ -2,14 +2,40 @@
scriptencoding utf-8 scriptencoding utf-8
" This requires the Python command to run the test server. " This requires the Python command to run the test server.
" This most likely only works on Unix. " This most likely only works on Unix and Windows console.
if !has('unix') || !executable('python') if has('unix')
if !executable('python')
finish
endif
elseif has('win32') && !has('gui_win32')
" Use Python Launcher for Windows (py.exe).
if !executable('py')
finish
endif
else
finish finish
endif endif
func Test_communicate() func s:start_server()
" The Python program writes the port number in Xportnr. if has('win32')
silent !start cmd /c start "test_channel" py test_channel.py
else
silent !./test_channel.py& silent !./test_channel.py&
endif
endfunc
func s:kill_server()
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
func Test_communicate()
call delete("Xportnr")
" The Python program writes the port number in Xportnr.
call s:start_server()
" Wait for up to 2 seconds for the port number to be there. " Wait for up to 2 seconds for the port number to be there.
let cnt = 20 let cnt = 20
@ -29,7 +55,7 @@ func Test_communicate()
if len(l) == 0 if len(l) == 0
" Can't make the connection, give up. " Can't make the connection, give up.
call system("killall test_channel.py") call s:kill_server()
return return
endif endif
let port = l[0] let port = l[0]
@ -49,5 +75,5 @@ func Test_communicate()
" make the server quit, can't check if this works, should not hang. " make the server quit, can't check if this works, should not hang.
call ch_sendexpr(handle, '!quit!', 0) call ch_sendexpr(handle, '!quit!', 0)
call system("killall test_channel.py") call s:kill_server()
endfunc endfunc

View File

@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1247,
/**/ /**/
1246, 1246,
/**/ /**/