summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-12 22:51:22 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-12 22:51:22 +0200
commit89b10421ca1aea55acbafac1df93be4e20210ceb (patch)
tree1d1bc73cedd32510fd398da16a528b71e6f58e82 /src/testdir
parente048539195e1c0a060cf41b39fca118130bdc151 (diff)
patch 7.4.2031v7.4.2031
Problem: The list_lbr_utf8 test fails if ~/.vim/syntax/c.vim sets 'textwidth' to a non-zero value. (Oyvind A. Holm) Solution: Add a setup.vim file that sets 'runtimepath' and $HOME to a safe value. (partly by Christian Brabandt, closes #912)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/amiga.vim2
-rw-r--r--src/testdir/dos.vim2
-rw-r--r--src/testdir/runtest.vim6
-rw-r--r--src/testdir/setup.vim11
-rw-r--r--src/testdir/unix.vim2
-rw-r--r--src/testdir/vms.vim4
6 files changed, 23 insertions, 4 deletions
diff --git a/src/testdir/amiga.vim b/src/testdir/amiga.vim
index e0ca47a8ed..79956d7d94 100644
--- a/src/testdir/amiga.vim
+++ b/src/testdir/amiga.vim
@@ -2,3 +2,5 @@
set shell=csh
map! /tmp t:
cmap !rm !Delete all
+
+source setup.vim
diff --git a/src/testdir/dos.vim b/src/testdir/dos.vim
index 27764db9d9..3ea6ab2a6d 100644
--- a/src/testdir/dos.vim
+++ b/src/testdir/dos.vim
@@ -5,3 +5,5 @@ set shell=c:\COMMAND.COM shellquote= shellxquote= shellcmdflag=/c shellredir=>
if executable("cmd.exe")
set shell=cmd.exe
endif
+
+source setup.vim
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index c094da0317..559d5f875a 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -42,6 +42,9 @@ if &lines < 24 || &columns < 80
cquit
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 nocp viminfo+=nviminfo
@@ -55,9 +58,6 @@ lang mess C
" Always use forward slashes.
set shellslash
-" Make sure $HOME does not get read or written.
-let $HOME = '/does/not/exist'
-
let s:srcdir = expand('%:p:h:h')
" Prepare for calling test_garbagecollect_now().
diff --git a/src/testdir/setup.vim b/src/testdir/setup.vim
new file mode 100644
index 0000000000..f7e475a81a
--- /dev/null
+++ b/src/testdir/setup.vim
@@ -0,0 +1,11 @@
+" Common preparations for running tests.
+
+" Make sure 'runtimepath' does not include $HOME.
+set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
+
+" Only when the +eval feature is present.
+if 1
+ " Make sure $HOME does not get read or written.
+ let $HOME = '/does/not/exist'
+endif
+
diff --git a/src/testdir/unix.vim b/src/testdir/unix.vim
index f766e74c30..36dd4e1e3b 100644
--- a/src/testdir/unix.vim
+++ b/src/testdir/unix.vim
@@ -1,3 +1,5 @@
" Settings for test script execution
" Always use "sh", don't use the value of "$SHELL".
set shell=sh
+
+source setup.vim
diff --git a/src/testdir/vms.vim b/src/testdir/vms.vim
index 3305a77c23..64b390e285 100644
--- a/src/testdir/vms.vim
+++ b/src/testdir/vms.vim
@@ -1,4 +1,6 @@
" Settings for test script execution under OpenVMS
-" Do not make any swap files
+" Do not use any swap files
set noswapfile
+
+source setup.vim