aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-06-17 17:11:41 +0200
committererw7 <erw7.github@gmail.com>2020-05-25 18:52:29 +0900
commit0cab85df4d465fae2973571ebbddbde54d45482b (patch)
tree69679b942f1cb054c0ebc88d45746c9be7bcb422 /src
parent7ac46b5d37ae04d30031a217dafed5f6f8c733ac (diff)
downloadrneovim-0cab85df4d465fae2973571ebbddbde54d45482b.tar.gz
rneovim-0cab85df4d465fae2973571ebbddbde54d45482b.tar.bz2
rneovim-0cab85df4d465fae2973571ebbddbde54d45482b.zip
vim-patch:8.1.1484: some tests are slow
Problem: Some tests are slow. Solution: Add timing to the test messages. Fix double free when quitting in VimLeavePre autocmd. https://github.com/vim/vim/commit/75ee544f99ca66be8105570c6309d95435ad30d1
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c6
-rw-r--r--src/nvim/testdir/runtest.vim16
2 files changed, 18 insertions, 4 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index f9e24e094d..b31b6bd0f8 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -439,12 +439,12 @@ void eval_clear(void)
xfree(SCRIPT_SV(i));
ga_clear(&ga_scripts);
- // unreferenced lists and dicts
- (void)garbage_collect(false);
-
// functions need to be freed before gargabe collecting, otherwise local
// variables might be freed twice.
free_all_functions();
+
+ // unreferenced lists and dicts
+ (void)garbage_collect(false);
}
#endif
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index adf7463936..e249d499c4 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -44,6 +44,10 @@ if &lines < 24 || &columns < 80
qa!
endif
+if has('reltime')
+ let s:start_time = reltime()
+endif
+
" Common with all tests on all systems.
source setup.vim
@@ -100,6 +104,9 @@ endfunc
func RunTheTest(test)
echo 'Executing ' . a:test
+ if has('reltime')
+ let func_start = reltime()
+ endif
" Avoid stopping at the "hit enter" prompt
set nomore
@@ -124,7 +131,11 @@ func RunTheTest(test)
endtry
endif
- call add(s:messages, 'Executing ' . a:test)
+ let message = 'Executed ' . a:test
+ if has('reltime')
+ let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
+ endif
+ call add(s:messages, message)
let s:done += 1
if a:test =~ 'Test_nocatch_'
@@ -230,6 +241,9 @@ func FinishTesting()
else
let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')
endif
+ if has('reltime')
+ let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds'
+ endif
echo message
call add(s:messages, message)
if s:fail > 0