-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking coverage with vimrunner #51
Comments
I'll have to look into covimerage and how it works, and experiment a bit maybe. For now, I could at least give you some things to try. For starters:
It's actually possible. Here's the implementation of the Lines 48 to 50 in 9cc6e9e
Basically, there's a vim = Server.new(executable: "/path/to/my-gvim").start You could also create an existing Vim instance, and then connect to it, as long as you spawn a Vim with a particular servername. Take a look at the documentation for |
Thanks! As for vim = Vimrunner::Server.new(:executable => Dir.getwd + "/bin/gvim").start() This is for a Vim plugin, which has some spec helpers already (https://github.com/Vimjas/vim-python-pep8-indent/blob/master/spec/spec_helper.rb), and I can use an env var for this then. Some findings:
This is the case for both using xvfb-run or without (i.e. gvim being visible). I have moved/commented the When using
One easy fix for this is to use |
The previous method of closing input/output unconditionally will cause Vim to end with SIGHUP, which causes a wrapping process using Python's `subprocess` module to abort: 10342 0.000166 write(1, "Vim: Finished.\r\n", 16) = -1 EIO (Input/output error) 10342 0.000169 rt_sigaction(SIGHUP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7ff4714958f0}, {sa_handler=SIG_IGN, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_REST> 10342 0.000122 rt_sigprocmask(SIG_UNBLOCK, [HUP], [HUP], 8) = 0 10342 0.000081 getpid() = 10342 10342 0.000058 kill(10342, SIGHUP) = 0 10342 0.000103 --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=10342, si_uid=1000} --- Using `:quitall!` and waiting for Vim to finish is cleaner. This also uses SIGTERM instead of SIGKILL. Fixes AndrewRadev#51.
Using |
Hmm, the problem seems to be rather that the SIGHUP is not forwarded to Vim by covimerage. |
This is necessary to quit Vim in case input/output is closed. Ref: AndrewRadev/vimrunner#51 (comment)
This is necessary to quit Vim in case input/output is closed. Ref: AndrewRadev/vimrunner#51 (comment)
This is necessary to quit Vim in case input/output is closed. Ref: AndrewRadev/vimrunner#51 (comment)
This is necessary to quit Vim in case input/output is closed. Ref: AndrewRadev/vimrunner#51 (comment)
Using config.start_vim do
vim = Vimrunner.connect(ENV['PYTHON_PEP8_INDENT_TEST_VIM_SERVERNAME'])
def vim.kill
normal(":quitall!<CR>")
end |
I am trying to track coverage with vimrunner (via https://github.com/Vimjas/covimerage/), but the problem appears to be that it spawns a gvim instance without waiting for it.
My current attempt is to have a
gvim
wrapper, which I inject into the$PATH
(it would be good to explicitly provide theexecutable
btw):I've tried using
&
andwait
here, but this script is already affected by thePTY.spawn
.Any hints?
The text was updated successfully, but these errors were encountered: