view src/testdir/setup.vim @ 11852:825a4717f14a v8.0.0806

patch 8.0.0806: tests may try to create XfakeHOME twice commit https://github.com/vim/vim/commit/f98246d4849e670c6660e97887428dcddf88dc9f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 29 22:21:18 2017 +0200 patch 8.0.0806: tests may try to create XfakeHOME twice Problem: Tests may try to create XfakeHOME twice. Solution: Avoid loading setup.vim twice.
author Christian Brabandt <cb@256bit.org>
date Sat, 29 Jul 2017 22:30:04 +0200
parents eb339f9af281
children 4276e114b34a
line wrap: on
line source

" Common preparations for running tests.

" Only load this once.
if 1
  if exists('s:did_load')
    finish
  endif
  let s:did_load = 1
endif

" Make sure 'runtimepath' and 'packpath' does not include $HOME.
set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
if has('packages')
  let &packpath = &rtp
endif

" Only when the +eval feature is present. 
if 1
  " Make sure the .Xauthority file can be found after changing $HOME.
  if $XAUTHORITY == ''
    let $XAUTHORITY = $HOME . '/.Xauthority'
  endif

  " Make sure $HOME does not get read or written.
  " It must exist, gnome tries to create $HOME/.gnome2
  let $HOME = getcwd() . '/XfakeHOME'
  call mkdir($HOME)
endif