aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-02 21:44:07 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 15:29:16 +0100
commite247dd25356217ace6023883ab6c98ff4d0a50e9 (patch)
tree6587189b26702b61b86e45bf2bc998906e8f660e /src
parent070f8df4dd0f9202d8ebc412ce267dc9aa7c8e71 (diff)
downloadrneovim-e247dd25356217ace6023883ab6c98ff4d0a50e9.tar.gz
rneovim-e247dd25356217ace6023883ab6c98ff4d0a50e9.tar.bz2
rneovim-e247dd25356217ace6023883ab6c98ff4d0a50e9.zip
test/oldtest: runtest.vim: align with upstream
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/runtest.vim20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index 40728f5729..daef9e146c 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -42,8 +42,9 @@ endif
" Common with all tests on all systems.
source setup.vim
+" For consistency run all tests with 'nocompatible' set.
" This also enables use of line continuation.
-set viminfo+=nviminfo
+set nocp viminfo+=nviminfo
" Use utf-8 or latin1 by default, instead of whatever the system default
" happens to be. Individual tests can overrule this at the top of the file.
@@ -62,9 +63,24 @@ lang mess C
" Always use forward slashes.
set shellslash
-" Prepare for calling garbagecollect_for_testing().
+" Prepare for calling test_garbagecollect_now().
let v:testing = 1
+" Support function: get the alloc ID by name.
+function GetAllocId(name)
+ exe 'split ' . s:srcdir . '/alloc.h'
+ let top = search('typedef enum')
+ if top == 0
+ call add(v:errors, 'typedef not found in alloc.h')
+ endif
+ let lnum = search('aid_' . a:name . ',')
+ if lnum == 0
+ call add(v:errors, 'Alloc ID ' . a:name . ' not defined')
+ endif
+ close
+ return lnum - top - 1
+endfunc
+
func RunTheTest(test)
echo 'Executing ' . a:test
if exists("*SetUp")