To: vim_dev@googlegroups.com Subject: Patch 8.0.09911 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0911 Problem: Terminal test takes too long. Solution: Instead of "sleep 1" use a Python program to briefly sleep. Files: src/testdir/test_terminal.vim, src/testdir/test_short_sleep.py *** ../vim-8.0.0910/src/testdir/test_terminal.vim 2017-08-11 22:27:44.513127603 +0200 --- src/testdir/test_terminal.vim 2017-08-11 22:43:13.742563761 +0200 *************** *** 6,11 **** --- 6,13 ---- source shared.vim + let s:python = PythonProg() + " Open a terminal with a shell, assign the job to g:job and return the buffer " number. func Run_shell_in_terminal(options) *************** *** 319,359 **** endfunc func Test_finish_close() - " TODO: use something that takes much less than a whole second - echo 'This will take five seconds...' call assert_equal(1, winnr('$')) ! if has('win32') ! let cmd = $windir . '\system32\timeout.exe 1' else ! let cmd = 'sleep 1' endif exe 'terminal ++close ' . cmd let buf = bufnr('') call assert_equal(2, winnr('$')) - wincmd p ! sleep 1200 msec call assert_equal(1, winnr('$')) call term_start(cmd, {'term_finish': 'close'}) call assert_equal(2, winnr('$')) let buf = bufnr('') wincmd p ! sleep 1200 msec call assert_equal(1, winnr('$')) exe 'terminal ++open ' . cmd let buf = bufnr('') close ! sleep 1200 msec call assert_equal(2, winnr('$')) bwipe call term_start(cmd, {'term_finish': 'open'}) let buf = bufnr('') close ! sleep 1200 msec call assert_equal(2, winnr('$')) bwipe --- 321,366 ---- endfunc func Test_finish_close() call assert_equal(1, winnr('$')) ! if s:python != '' ! let cmd = s:python . " test_short_sleep.py" ! let waittime = 500 else ! echo 'This will take five seconds...' ! let waittime = 2000 ! if has('win32') ! let cmd = $windir . '\system32\timeout.exe 1' ! else ! let cmd = 'sleep 1' ! endif endif + exe 'terminal ++close ' . cmd let buf = bufnr('') call assert_equal(2, winnr('$')) wincmd p ! call WaitFor("winnr('$') == 1", waittime) call assert_equal(1, winnr('$')) call term_start(cmd, {'term_finish': 'close'}) call assert_equal(2, winnr('$')) let buf = bufnr('') wincmd p ! call WaitFor("winnr('$') == 1", waittime) call assert_equal(1, winnr('$')) exe 'terminal ++open ' . cmd let buf = bufnr('') close ! call WaitFor("winnr('$') == 2", waittime) call assert_equal(2, winnr('$')) bwipe call term_start(cmd, {'term_finish': 'open'}) let buf = bufnr('') close ! call WaitFor("winnr('$') == 2", waittime) call assert_equal(2, winnr('$')) bwipe *** ../vim-8.0.0910/src/testdir/test_short_sleep.py 2017-08-11 22:44:11.578155307 +0200 --- src/testdir/test_short_sleep.py 2017-08-11 22:31:11.635664630 +0200 *************** *** 0 **** --- 1,11 ---- + #!/usr/bin/python + # + # Program that sleeps for 100 msec + # + # This requires Python 2.6 or later. + + import time + + if __name__ == "__main__": + + time.sleep(0.1) # sleep 100 msec *** ../vim-8.0.0910/src/version.c 2017-08-11 22:27:44.513127603 +0200 --- src/version.c 2017-08-11 22:32:18.603191534 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 911, /**/ -- Yesterday, all my deadlines seemed so far away now it looks as though it's freeze in four days oh I believe in cvs.. [ CVS log "Beatles style" for FreeBSD ports/INDEX, Satoshi Asami ] /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///