1
0
forked from aniani/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 #11065)
This commit is contained in:
K.Takata 2022-09-06 10:56:19 +01:00 committed by Bram Moolenaar
parent e53a0d4409
commit a9480dbc8c
2 changed files with 15 additions and 7 deletions

View File

@ -111,10 +111,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')
@ -129,21 +130,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.

View File

@ -703,6 +703,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
393,
/**/
392,
/**/