blob: cb8bebb47a273deba681625acb61cc3c445d9a30 [file] [log] [blame]
Bram Moolenaar89b10422016-07-12 22:51:22 +02001" Common preparations for running tests.
2
Bram Moolenaarf98246d2017-07-29 22:21:18 +02003" Only load this once.
4if 1
5 if exists('s:did_load')
6 finish
7 endif
8 let s:did_load = 1
9endif
10
Bram Moolenaar66459b72016-08-06 19:01:55 +020011" Make sure 'runtimepath' and 'packpath' does not include $HOME.
Bram Moolenaar89b10422016-07-12 22:51:22 +020012set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
Bram Moolenaarc96a2f32016-08-06 19:45:31 +020013if has('packages')
14 let &packpath = &rtp
15endif
Bram Moolenaar89b10422016-07-12 22:51:22 +020016
17" Only when the +eval feature is present.
18if 1
Bram Moolenaar11e79bb2017-07-08 17:03:21 +020019 " Make sure the .Xauthority file can be found after changing $HOME.
20 if $XAUTHORITY == ''
21 let $XAUTHORITY = $HOME . '/.Xauthority'
22 endif
23
Bram Moolenaar89b10422016-07-12 22:51:22 +020024 " Make sure $HOME does not get read or written.
Bram Moolenaard1ee0042017-07-29 20:39:53 +020025 " It must exist, gnome tries to create $HOME/.gnome2
26 let $HOME = getcwd() . '/XfakeHOME'
Bram Moolenaard0b6c6c2017-07-30 13:28:23 +020027 if !isdirectory($HOME)
28 call mkdir($HOME)
29 endif
Bram Moolenaar89b10422016-07-12 22:51:22 +020030endif