aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/testdir/check.vim8
-rw-r--r--src/nvim/testdir/shared.vim6
-rw-r--r--src/nvim/testdir/test_exit.vim1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim
index d200633115..a188f7afa1 100644
--- a/src/nvim/testdir/check.vim
+++ b/src/nvim/testdir/check.vim
@@ -171,6 +171,14 @@ func CheckNotAsan()
endif
endfunc
+" Command to check for not running under valgrind
+command CheckNotValgrind call CheckNotValgrind()
+func CheckNotValgrind()
+ if RunningWithValgrind()
+ throw 'Skipped: does not work well with valgrind'
+ endif
+endfunc
+
" Command to check for X11 based GUI
command CheckX11BasedGui call CheckX11BasedGui()
func CheckX11BasedGui()
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() =~ '\<valgrind\>'
+endfunc
+
" Get the command to run Vim, with --clean instead of "-u NONE".
func GetVimCommandClean()
let cmd = GetVimCommand()
diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim
index 37be293950..6dbfb7047c 100644
--- a/src/nvim/testdir/test_exit.vim
+++ b/src/nvim/testdir/test_exit.vim
@@ -117,6 +117,7 @@ func Test_exit_error_reading_input()
CheckNotMSWindows
" The early exit causes memory not to be freed somehow
CheckNotAsan
+ CheckNotValgrind
call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew", "q:"], 'Xscript', 'b')