commit 0412dba45622eeb20e83d5458bab8714e2da0d2e
parent fe5318293442aabdd4c7fd12ad892adcba1f80fb
Author: Sean Dewar <seandewar@users.noreply.github.com>
Date: Fri, 25 Feb 2022 00:20:35 +0000
vim-patch:8.2.4444: beep caused by test
Problem: Beep caused by test. ASAN reports leaks.
Solution: Do not put a NL at the end of the script. Make the text work on
MS-Windows. Do not run the test with ASAN.
https://github.com/vim/vim/commit/68eab67119734ea1efc7cef1287276d969f2713a
The test is skipped, but cherry-pick CheckNotAsan from v8.2.2424 anyway.
https://github.com/vim/vim/commit/97202d951685fc4d90085da676a90644cbf72571
Diffstat:
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim
@@ -137,6 +137,14 @@ func CheckNotMSWindows()
endif
endfunc
+" Command to check for not running under ASAN
+command CheckNotAsan call CheckNotAsan()
+func CheckNotAsan()
+ if execute('version') =~# '-fsanitize=[a-z,]*\<address\>'
+ throw 'Skipped: does not work with ASAN'
+ endif
+endfunc
+
" Command to check for satisfying any of the conditions.
" e.g. CheckAnyOf Feature:bsd Feature:sun Linux
command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)
diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim
@@ -114,13 +114,14 @@ func Test_exit_error_reading_input()
throw 'Skipped: Nvim does not exit after stdin is read'
CheckNotGui
- CheckNotMSWindows
+ " The early exit causes memory not to be freed somehow
+ CheckNotAsan
- call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew\<CR>q:"], 'Xscript')
+ call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew", "q:"], 'Xscript', 'b')
" Nvim requires "-s -" to read stdin as Normal mode input
- " if RunVim([], [], '< Xscript')
- if RunVim([], [], '-s - < Xscript')
+ " if RunVim([], [], '<Xscript')
+ if RunVim([], [], '-s - <Xscript')
call assert_equal(['l = 1'], readfile('Xtestout'))
endif
call delete('Xscript')