From 76aede11622aa790cbe5de629b0fb9c9fe2770ab Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 16 Jul 2024 14:36:18 +0800 Subject: vim-patch:8.2.2276: list of distributed files is outdated Problem: List of distributed files is outdated. Solution: Update the file list. Minor comment updates. https://github.com/vim/vim/commit/a72514945bc3edd4fc4d745004e37c5d5487c98d Co-authored-by: Bram Moolenaar --- test/old/testdir/test_signals.vim | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/old/testdir/test_signals.vim b/test/old/testdir/test_signals.vim index 667448a7c2..2f9b6c09d8 100644 --- a/test/old/testdir/test_signals.vim +++ b/test/old/testdir/test_signals.vim @@ -86,8 +86,8 @@ func Test_signal_INT() throw 'Skipped: INT signal not supported' endif - " Skip the rest of the test when running with valgrind as signal INT is not - " received somehow by Vim when running with valgrind. + " Skip the test when running with valgrind as signal INT is not received + " somehow by Vim when running with valgrind. let cmd = GetVimCommand() if cmd =~ 'valgrind' throw 'Skipped: cannot test signal INT with valgrind' @@ -120,10 +120,6 @@ func Test_deadly_signal_TERM() throw 'Skipped: TERM signal not supported' endif CheckRunVimInTerminal - let cmd = GetVimCommand() - if cmd =~ 'valgrind' - throw 'Skipped: cannot test signal TERM with valgrind' - endif " If test fails once, it can leave temporary files and trying to rerun " the test would then fail again if they are not deleted first. -- cgit From a35eda36c34ed9d43d775335f87e8719d383e2d4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 16 Jul 2024 14:33:30 +0800 Subject: vim-patch:8.2.5158: TSTP and INT signal tests are not run with valgrind Problem: TSTP and INT signal tests are not run with valgrind. Solution: Sleep a bit longer. (closes vim/vim#10614) https://github.com/vim/vim/commit/61e3784819d3776ec6fb40d97a12a1bb659e8143 Cherry-pick Test_signal_TSTP() from patch 8.2.3941. Co-authored-by: Bram Moolenaar --- test/old/testdir/test_signals.vim | 55 ++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/test/old/testdir/test_signals.vim b/test/old/testdir/test_signals.vim index 2f9b6c09d8..b2dd7f9173 100644 --- a/test/old/testdir/test_signals.vim +++ b/test/old/testdir/test_signals.vim @@ -86,26 +86,67 @@ func Test_signal_INT() throw 'Skipped: INT signal not supported' endif - " Skip the test when running with valgrind as signal INT is not received - " somehow by Vim when running with valgrind. - let cmd = GetVimCommand() - if cmd =~ 'valgrind' - throw 'Skipped: cannot test signal INT with valgrind' - endif - let buf = RunVimInTerminal('', {'rows': 6}) let pid_vim = term_getjob(buf)->job_info().process " Check that an endless loop in Vim is interrupted by signal INT. + call term_sendkeys(buf, ":call setline(1, 'running')\n") call term_sendkeys(buf, ":while 1 | endwhile\n") call WaitForAssert({-> assert_equal(':while 1 | endwhile', term_getline(buf, 6))}) exe 'silent !kill -s INT ' .. pid_vim + sleep 50m call term_sendkeys(buf, ":call setline(1, 'INTERRUPTED')\n") call WaitForAssert({-> assert_equal('INTERRUPTED', term_getline(buf, 1))}) call StopVimInTerminal(buf) endfunc +" Test signal TSTP. Handler sets got_tstp. +func Test_signal_TSTP() + CheckRunVimInTerminal + if !HasSignal('TSTP') + throw 'Skipped: TSTP signal not supported' + endif + + " If test fails once, it can leave temporary files and trying to rerun + " the test would then fail again if they are not deleted first. + call delete('.Xsig_TERM.swp') + call delete('XsetupAucmd') + call delete('XautoOut') + let lines =<< trim END + au VimSuspend * call writefile(["VimSuspend triggered"], "XautoOut", "as") + au VimResume * call writefile(["VimResume triggered"], "XautoOut", "as") + END + call writefile(lines, 'XsetupAucmd') + + let buf = RunVimInTerminal('-S XsetupAucmd Xsig_TERM', {'rows': 6}) + let pid_vim = term_getjob(buf)->job_info().process + + call term_sendkeys(buf, ":call setline(1, 'foo')\n") + call WaitForAssert({-> assert_equal('foo', term_getline(buf, 1))}) + + call assert_false(filereadable('Xsig_TERM')) + + " After TSTP the file is not saved (same function as ^Z) + exe 'silent !kill -s TSTP ' .. pid_vim + call WaitForAssert({-> assert_true(filereadable('.Xsig_TERM.swp'))}) + + " We resume after the suspend. Sleep a bit for the signal to take effect, + " also when running under valgrind. + exe 'silent !kill -s CONT ' .. pid_vim + sleep 100m + + call StopVimInTerminal(buf) + + let result = readfile('XautoOut') + call assert_equal(["VimSuspend triggered", "VimResume triggered"], result) + + %bwipe! + call delete('.Xsig_TERM.swp') + call delete('XsetupAucmd') + call delete('XautoOut') +endfunc + " Test a deadly signal. " " There are several deadly signals: SISEGV, SIBUS, SIGTERM... -- cgit From e84a4c5a987f2bb428d46a73bed175ba36729be5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 16 Jul 2024 14:40:48 +0800 Subject: vim-patch:9.0.0393: signals test often fails on FreeBSD Problem: Signals test often fails on FreeBSD. Solution: Use separate files for Suspend and Resume. (Ken Takata, closes vim/vim#11065) https://github.com/vim/vim/commit/a9480dbc8c4381e4139db1ab7969722f4d100bac Co-authored-by: K.Takata --- test/old/testdir/test_signals.vim | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test/old/testdir/test_signals.vim b/test/old/testdir/test_signals.vim index b2dd7f9173..3ec4b975e1 100644 --- a/test/old/testdir/test_signals.vim +++ b/test/old/testdir/test_signals.vim @@ -112,10 +112,11 @@ func Test_signal_TSTP() " the test would then fail again if they are not deleted first. call delete('.Xsig_TERM.swp') call delete('XsetupAucmd') - call delete('XautoOut') + call delete('XautoOut1') + call delete('XautoOut2') let lines =<< trim END - au VimSuspend * call writefile(["VimSuspend triggered"], "XautoOut", "as") - au VimResume * call writefile(["VimResume triggered"], "XautoOut", "as") + au VimSuspend * call writefile(["VimSuspend triggered"], "XautoOut1", "as") + au VimResume * call writefile(["VimResume triggered"], "XautoOut2", "as") END call writefile(lines, 'XsetupAucmd') @@ -130,21 +131,26 @@ func Test_signal_TSTP() " After TSTP the file is not saved (same function as ^Z) exe 'silent !kill -s TSTP ' .. pid_vim call WaitForAssert({-> assert_true(filereadable('.Xsig_TERM.swp'))}) + sleep 100m " We resume after the suspend. Sleep a bit for the signal to take effect, " also when running under valgrind. exe 'silent !kill -s CONT ' .. pid_vim - sleep 100m + call WaitForAssert({-> assert_true(filereadable('XautoOut2'))}) + sleep 10m call StopVimInTerminal(buf) - let result = readfile('XautoOut') - call assert_equal(["VimSuspend triggered", "VimResume triggered"], result) + let result = readfile('XautoOut1') + call assert_equal(["VimSuspend triggered"], result) + let result = readfile('XautoOut2') + call assert_equal(["VimResume triggered"], result) %bwipe! call delete('.Xsig_TERM.swp') call delete('XsetupAucmd') - call delete('XautoOut') + call delete('XautoOut1') + call delete('XautoOut2') endfunc " Test a deadly signal. -- cgit