Patch 8.0.1623
Problem: Terminal kill tests are flaky.
Solution: Instead of running Vim in a terminal, run it as a normal command.
Files: src/testdir/test_terminal.vim
*** ../vim-8.0.1622/src/testdir/test_terminal.vim 2018-03-16
22:54:47.338973112 +0100
--- src/testdir/test_terminal.vim 2018-03-20 17:40:28.323093596 +0100
***************
*** 855,903 ****
unlet g:job
endfunc
! " Run Vim in a terminal, then start a terminal in that Vim with a kill
! " argument, check that :qall works.
! func Test_terminal_qall_kill_arg()
! if !CanRunVimInTerminal()
return
endif
! let buf = RunVimInTerminal('', {})
!
! " Open a terminal window and wait for the prompt to appear
! call term_sendkeys(buf, ":term ++kill=kill\<CR>")
! call WaitFor({-> term_getline(buf, 10) =~ '\[running]'})
! call WaitFor({-> term_getline(buf, 1) !~ '^\s*$'})
!
! " make Vim exit, it will kill the shell
! call term_sendkeys(buf, "\<C-W>:qall\<CR>")
! call WaitFor({-> term_getstatus(buf) == "finished"})
!
! " close the terminal window where Vim was running
! quit
endfunc
" Run Vim in a terminal, then start a terminal in that Vim with a kill
" argument, check that :qall works.
func Test_terminal_qall_kill_func()
! if !CanRunVimInTerminal()
return
endif
! let buf = RunVimInTerminal('', {})
!
! " Open a terminal window and wait for the prompt to appear
! call term_sendkeys(buf, ":term\<CR>")
! call WaitFor({-> term_getline(buf, 10) =~ '\[running]'})
! call WaitFor({-> term_getline(buf, 1) !~ '^\s*$'})
!
! " set kill using term_setkill()
! call term_sendkeys(buf, "\<C-W>:call term_setkill(bufnr('%'), 'kill')\<CR>")
!
! " make Vim exit, it will kill the shell
! call term_sendkeys(buf, "\<C-W>:qall\<CR>")
! call WaitFor({-> term_getstatus(buf) == "finished"})
!
! " close the terminal window where Vim was running
! quit
endfunc
" Run Vim in a terminal, then start a terminal in that Vim without a kill
--- 855,915 ----
unlet g:job
endfunc
! " Run Vim, start a terminal in that Vim with the kill argument,
! " :qall works.
! func Run_terminal_qall_kill(line1, line2)
! " 1. Open a terminal window and wait for the prompt to appear
! " 2. set kill using term_setkill()
! " 3. make Vim exit, it will kill the shell
! let after = [
! \ a:line1,
! \ 'let buf = bufnr("%")',
! \ 'while term_getline(buf, 1) =~ "^\\s*$"',
! \ ' sleep 10m',
! \ 'endwhile',
! \ a:line2,
! \ 'au VimLeavePre * call writefile(["done"], "Xdone")',
! \ 'qall',
! \ ]
! if !RunVim([], after, '')
return
endif
! call assert_equal("done", readfile("Xdone")[0])
! call delete("Xdone")
endfunc
" Run Vim in a terminal, then start a terminal in that Vim with a kill
" argument, check that :qall works.
+ func Test_terminal_qall_kill_arg()
+ call Run_terminal_qall_kill('term ++kill=kill', '')
+ endfunc
+
+ " Run Vim, start a terminal in that Vim, set the kill argument with
+ " term_setkill(), check that :qall works.
func Test_terminal_qall_kill_func()
! call Run_terminal_qall_kill('term', 'call term_setkill(buf, "kill")')
! endfunc
!
! " Run Vim, start a terminal in that Vim without the kill argument,
! " check that :qall does not exit, :qall! does.
! func Test_terminal_qall_exit()
! let after = [
! \ 'term',
! \ 'let buf = bufnr("%")',
! \ 'while term_getline(buf, 1) =~ "^\\s*$"',
! \ ' sleep 10m',
! \ 'endwhile',
! \ 'set nomore',
! \ 'au VimLeavePre * call writefile(["too early"], "Xdone")',
! \ 'qall',
! \ 'au! VimLeavePre * exe buf . "bwipe!" | call writefile(["done"],
"Xdone")',
! \ 'cquit',
! \ ]
! if !RunVim([], after, '')
return
endif
! call assert_equal("done", readfile("Xdone")[0])
! call delete("Xdone")
endfunc
" Run Vim in a terminal, then start a terminal in that Vim without a kill
*** ../vim-8.0.1622/src/version.c 2018-03-20 13:30:38.541270285 +0100
--- src/version.c 2018-03-20 17:42:15.366503063 +0100
***************
*** 768,769 ****
--- 768,771 ----
{ /* Add new patch number below this line */
+ /**/
+ 1623,
/**/
--
hundred-and-one symptoms of being an internet addict:
33. You name your children Eudora, Mozilla and Dotcom.
/// 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.