From 8d6a217b9a1c3db6ed4ee8fabee20ca75a515857 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 5 Nov 2022 20:25:07 +0800 Subject: vim-patch:8.2.1383: test 49 is old style Problem: Test 49 is old style. Solution: Convert test cases to new style. (Yegappan Lakshmanan, closes vim/vim#6638) https://github.com/vim/vim/commit/9470a4d88acf948af1596101527b3a505f8c14e9 Cherry-pick AssertException() from patch 8.2.1146. --- src/nvim/testdir/shared.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/testdir/shared.vim') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index c2809844ac..ef7cc4ac5f 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -364,4 +364,19 @@ func GetMessages() return msg_list endfunc +" Run the list of commands in 'cmds' and look for 'errstr' in exception. +" Note that assert_fails() cannot be used in some places and this function +" can be used. +func AssertException(cmds, errstr) + let save_exception = '' + try + for cmd in a:cmds + exe cmd + endfor + catch + let save_exception = v:exception + endtry + call assert_match(a:errstr, save_exception) +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit From 9ae6b03e7aaf635da5d39c1bd7ff6829cc232acb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 5 Dec 2022 09:53:31 +0800 Subject: vim-patch:8.2.5145: exit test causes spurious valgrind reports Problem: Exit test causes spurious valgrind reports. Solution: Skip test. Add CheckNotValgrind. https://github.com/vim/vim/commit/cf801d4b95180ddaee1bf633ef482232625dd80b Cherry-pick RunningWithValgrind() from patch 8.2.5136. Co-authored-by: Bram Moolenaar --- src/nvim/testdir/shared.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir/shared.vim') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index ef7cc4ac5f..953118f650 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -285,6 +285,12 @@ func GetVimCommand(...) return cmd endfunc +" Return one when it looks like the tests are run with valgrind, which means +" that everything is much slower. +func RunningWithValgrind() + return GetVimCommand() =~ '\' +endfunc + " Get the command to run Vim, with --clean instead of "-u NONE". func GetVimCommandClean() let cmd = GetVimCommand() -- cgit From 4f64aef29f24b5ac305b609d0abf78d93e2c5e0d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 8 Dec 2022 18:58:06 +0800 Subject: vim-patch:8.2.3564: invalid memory access when scrolling without valid screen (#21335) vim-patch:8.2.3564: invalid memory access when scrolling without valid screen Problem: Invalid memory access when scrolling without a valid screen. Solution: Do not set VALID_BOTLINE in w_valid. https://github.com/vim/vim/commit/777e7c21b7627be80961848ac560cb0a9978ff43 Remove -Z flag when using RunVim(). Co-authored-by: Bram Moolenaar --- src/nvim/testdir/shared.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir/shared.vim') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 953118f650..aba995e788 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -323,7 +323,6 @@ func RunVim(before, after, arguments) endfunc func RunVimPiped(before, after, arguments, pipecmd) - let $NVIM_LOG_FILE = exists($NVIM_LOG_FILE) ? $NVIM_LOG_FILE : 'Xnvim.log' let cmd = GetVimCommand() let args = '' if len(a:before) > 0 @@ -338,7 +337,9 @@ func RunVimPiped(before, after, arguments, pipecmd) " Optionally run Vim under valgrind " let cmd = 'valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind ' . cmd - exe "silent !" . a:pipecmd . cmd . args . ' ' . a:arguments + let $NVIM_LOG_FILE = exists($NVIM_LOG_FILE) ? $NVIM_LOG_FILE : 'Xnvim.log' + " Nvim does not support -Z flag, remove it. + exe "silent !" . a:pipecmd . cmd . args . ' ' . substitute(a:arguments, '-Z', '', 'g') if len(a:before) > 0 call delete('Xbefore.vim') -- cgit From 8b3412636a1027eaa14a95211efb449b58e9a01e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 9 Dec 2022 07:51:37 +0800 Subject: test(old): change $TMPDIR from Xtest-tmpdir to X-test-tmpdir (#21346) I've noticed a patch 8.2.4376 that uses more Xtest directories. Change $TMPDIR to X-test-tmpdir to avoid more future divergence. --- src/nvim/testdir/shared.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir/shared.vim') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index aba995e788..33f6d9a2d0 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -9,7 +9,7 @@ source view_util.vim " {Nvim} " Filepath captured from output may be truncated, like this: -" /home/va...estdir/Xtest-tmpdir/nvimxbXN4i/10 +" /home/va...estdir/X-test-tmpdir/nvimxbXN4i/10 " Get last 2 segments, then combine with $TMPDIR. func! Fix_truncated_tmpfile(fname) " sanity check -- cgit