summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-06 18:05:25 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-06 18:05:25 +0200
commit75ee544f99ca66be8105570c6309d95435ad30d1 (patch)
tree63caa3b09137b92ecf4bd6ffcc87a9f98dc4e38c
parent5d30ff19648d2ff0696cea97582b902f6a4ec0ba (diff)
downloadvim-git-75ee544f99ca66be8105570c6309d95435ad30d1.tar.gz
patch 8.1.1484: some tests are slowv8.1.1484
Problem: Some tests are slow. Solution: Add timing to the test messages. Fix double free when quitting in VimLeavePre autocmd.
-rw-r--r--src/eval.c9
-rw-r--r--src/testdir/runtest.vim16
-rw-r--r--src/version.c2
3 files changed, 22 insertions, 5 deletions
diff --git a/src/eval.c b/src/eval.c
index af7a4af8a..5452f4543 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -430,11 +430,12 @@ eval_clear(void)
vim_free(SCRIPT_SV(i));
ga_clear(&ga_scripts);
- /* unreferenced lists and dicts */
- (void)garbage_collect(FALSE);
-
- /* functions */
+ // 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/testdir/runtest.vim b/src/testdir/runtest.vim
index 02d4d20e3..f855f6800 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -42,6 +42,10 @@ if &lines < 24 || &columns < 80
cquit
endif
+if has('reltime')
+ let s:start_time = reltime()
+endif
+
" Common with all tests on all systems.
source setup.vim
@@ -99,6 +103,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
@@ -126,7 +133,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_'
@@ -232,6 +243,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
diff --git a/src/version.c b/src/version.c
index c8a3cf670..bbfbfe17d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1484,
+/**/
1483,
/**/
1482,