To: vim_dev@googlegroups.com Subject: Patch 8.2.5143 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5143 Problem: Some tests fail when using valgrind. Spurious leak reports. Solution: Use WaitForAssert(). Avoid failing fork/exec. Skip tests where a job is killed when running valgrind. Files: src/testdir/test_iminsert.vim, src/testdir/test_popup.vim, src/testdir/test_cscope.vim, src/testdir/test_channel.vim *** ../vim-8.2.5142/src/testdir/test_iminsert.vim 2022-05-26 13:16:21.519092839 +0100 --- src/testdir/test_iminsert.vim 2022-06-21 16:24:56.268956097 +0100 *************** *** 81,91 **** END call writefile(lines, 'Xscript') let buf = RunVimInTerminal('-S Xscript', {}) - call term_wait(buf) call assert_notequal('abc', term_getline(buf, 2)) call term_sendkeys(buf, "/abc\n") ! call term_wait(buf) ! call assert_equal('abc', term_getline(buf, 2)) " clean up call StopVimInTerminal(buf) --- 81,89 ---- END call writefile(lines, 'Xscript') let buf = RunVimInTerminal('-S Xscript', {}) call assert_notequal('abc', term_getline(buf, 2)) call term_sendkeys(buf, "/abc\n") ! call WaitForAssert({-> assert_equal('abc', term_getline(buf, 2))}) " clean up call StopVimInTerminal(buf) *** ../vim-8.2.5142/src/testdir/test_popup.vim 2022-05-27 17:26:50.546119970 +0100 --- src/testdir/test_popup.vim 2022-06-21 16:41:32.600793432 +0100 *************** *** 1177,1189 **** END call writefile(lines, 'Xtest1') let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {}) - call term_wait(buf) call term_sendkeys(buf, "Go\") call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8}) call term_sendkeys(buf, "\\") ! call term_wait(buf) redraw! ! call assert_match('\s*miv', Screenline(5)) " Test for expanding tabs to spaces in the popup menu let lines =<< trim END --- 1177,1188 ---- END call writefile(lines, 'Xtest1') let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {}) call term_sendkeys(buf, "Go\") call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8}) call term_sendkeys(buf, "\\") ! call TermWait(buf, 30) redraw! ! call WaitForAssert({-> assert_match('\s*miv', Screenline(5))}) " Test for expanding tabs to spaces in the popup menu let lines =<< trim END *************** *** 1193,1207 **** END call writefile(lines, 'Xtest2') call term_sendkeys(buf, "\:e! Xtest2\") ! call term_wait(buf) call term_sendkeys(buf, "Goone\\") ! call term_wait(buf) redraw! call VerifyScreenDump(buf, 'Test_pum_rightleft_02', {'rows': 7}) call term_sendkeys(buf, "\") ! call term_wait(buf) redraw! ! call assert_match('\s*eerht eno', Screenline(4)) call StopVimInTerminal(buf) call delete('Xtest1') --- 1192,1206 ---- END call writefile(lines, 'Xtest2') call term_sendkeys(buf, "\:e! Xtest2\") ! call TermWait(buf, 30) call term_sendkeys(buf, "Goone\\") ! call TermWait(buf, 30) redraw! call VerifyScreenDump(buf, 'Test_pum_rightleft_02', {'rows': 7}) call term_sendkeys(buf, "\") ! call TermWait(buf, 30) redraw! ! call WaitForAssert({-> assert_match('\s*eerht eno', Screenline(4))}) call StopVimInTerminal(buf) call delete('Xtest1') *************** *** 1218,1232 **** END call writefile(lines, 'Xtest1') let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {}) ! call term_wait(buf) call term_sendkeys(buf, "Go\\\") call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7}) call term_sendkeys(buf, "\\dd") ! call term_wait(buf) if has('rightleft') call term_sendkeys(buf, ":set rightleft\") ! call term_wait(buf) call term_sendkeys(buf, "Go\\\") call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7}) endif --- 1217,1231 ---- END call writefile(lines, 'Xtest1') let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {}) ! call TermWait(buf) call term_sendkeys(buf, "Go\\\") call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7}) call term_sendkeys(buf, "\\dd") ! call TermWait(buf) if has('rightleft') call term_sendkeys(buf, ":set rightleft\") ! call TermWait(buf) call term_sendkeys(buf, "Go\\\") call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7}) endif *** ../vim-8.2.5142/src/testdir/test_cscope.vim 2022-01-13 18:09:08.245764844 +0000 --- src/testdir/test_cscope.vim 2022-06-21 16:53:03.249146542 +0100 *************** *** 244,253 **** call assert_equal('', a) " Test: 'csprg' option ! call assert_equal('cscope', &csprg) ! set csprg=doesnotexist ! call assert_fails('cscope add Xcscope2.out', 'E262:') ! set csprg=cscope " Test: multiple cscope connections cscope add Xcscope.out --- 244,256 ---- call assert_equal('', a) " Test: 'csprg' option ! " Skip this with valgrind, it causes spurious leak reports ! if !RunningWithValgrind() ! call assert_equal('cscope', &csprg) ! set csprg=doesnotexist ! call assert_fails('cscope add Xcscope2.out', 'E262:') ! set csprg=cscope ! endif " Test: multiple cscope connections cscope add Xcscope.out *** ../vim-8.2.5142/src/testdir/test_channel.vim 2022-06-19 11:45:42.654832438 +0100 --- src/testdir/test_channel.vim 2022-06-21 17:39:24.672720931 +0100 *************** *** 1201,1219 **** call job_stop(job) endtry ! let job = job_start(s:python . " test_channel_pipe.py something", ! \ {'out_io': 'null', 'err_io': 'out'}) ! call assert_equal("run", job_status(job)) ! call job_stop(job) ! let job = job_start(s:python . " test_channel_pipe.py something", ! \ {'in_io': 'null', 'out_io': 'null', 'err_io': 'null'}) ! call assert_equal("run", job_status(job)) ! call assert_equal('channel fail', string(job_getchannel(job))) ! call assert_equal('fail', ch_status(job)) ! call assert_equal('no process', string(test_null_job())) ! call assert_equal('channel fail', string(test_null_channel())) ! call job_stop(job) endfunc func Test_pipe_to_buffer_raw() --- 1201,1222 ---- call job_stop(job) endtry ! " This causes spurious leak errors with valgrind. ! if !RunningWithValgrind() ! let job = job_start(s:python . " test_channel_pipe.py something", ! \ {'out_io': 'null', 'err_io': 'out'}) ! call assert_equal("run", job_status(job)) ! call job_stop(job) ! let job = job_start(s:python . " test_channel_pipe.py something", ! \ {'in_io': 'null', 'out_io': 'null', 'err_io': 'null'}) ! call assert_equal("run", job_status(job)) ! call assert_equal('channel fail', string(job_getchannel(job))) ! call assert_equal('fail', ch_status(job)) ! call assert_equal('no process', string(test_null_job())) ! call assert_equal('channel fail', string(test_null_channel())) ! call job_stop(job) ! endif endfunc func Test_pipe_to_buffer_raw() *************** *** 1760,1778 **** call assert_fails("call job_start('ls', \ {'err_io' : 'buffer', 'err_buf' : -1})", 'E475:') set nomodifiable ! call assert_fails("call job_start('cmd /c dir', \ {'out_io' : 'buffer', 'out_buf' :" .. bufnr() .. "})", 'E21:') ! call assert_fails("call job_start('cmd /c dir', \ {'err_io' : 'buffer', 'err_buf' :" .. bufnr() .. "})", 'E21:') set modifiable ! call assert_fails("call job_start('ls', {'in_io' : 'buffer'})", 'E915:') edit! XXX let bnum = bufnr() enew ! call assert_fails("call job_start('ls', \ {'in_io' : 'buffer', 'in_buf' : bnum})", 'E918:') " Empty job tests --- 1763,1783 ---- call assert_fails("call job_start('ls', \ {'err_io' : 'buffer', 'err_buf' : -1})", 'E475:') + let cmd = has('win32') ? "cmd /c dir" : "ls" + set nomodifiable ! call assert_fails("call job_start(cmd, \ {'out_io' : 'buffer', 'out_buf' :" .. bufnr() .. "})", 'E21:') ! call assert_fails("call job_start(cmd, \ {'err_io' : 'buffer', 'err_buf' :" .. bufnr() .. "})", 'E21:') set modifiable ! call assert_fails("call job_start(cmd, {'in_io' : 'buffer'})", 'E915:') edit! XXX let bnum = bufnr() enew ! call assert_fails("call job_start(cmd, \ {'in_io' : 'buffer', 'in_buf' : bnum})", 'E918:') " Empty job tests *************** *** 1787,1792 **** --- 1792,1802 ---- endfunc func Test_job_stop_immediately() + " With valgrind this causes spurious leak reports + if RunningWithValgrind() + return + endif + let g:job = job_start([s:python, '-c', 'import time;time.sleep(10)']) try eval g:job->job_stop() *** ../vim-8.2.5142/src/version.c 2022-06-21 14:38:35.862067578 +0100 --- src/version.c 2022-06-21 17:36:40.656749570 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5143, /**/ -- Back off man, I'm a scientist. -- Peter, Ghostbusters /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///