blob: 485675aa33506432a01fc356f54bac66f5019523 [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
Bram Moolenaarc255b782022-11-26 19:16:48 +00005
6 " When using xterm version 377 the response to the modifyOtherKeys status
7 " interferes with some tests. Remove the request from the t_TI termcap
8 " entry.
9 let &t_TI = substitute(&t_TI, "\<Esc>\\[?4m", '', '')
10
Bram Moolenaarf98246d2017-07-29 22:21:18 +020011 if exists('s:did_load')
12 finish
13 endif
14 let s:did_load = 1
15endif
16
Bram Moolenaar66459b72016-08-06 19:01:55 +020017" Make sure 'runtimepath' and 'packpath' does not include $HOME.
Bram Moolenaar89b10422016-07-12 22:51:22 +020018set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
Bram Moolenaarc96a2f32016-08-06 19:45:31 +020019if has('packages')
20 let &packpath = &rtp
21endif
Bram Moolenaar89b10422016-07-12 22:51:22 +020022
Bram Moolenaar94722c52023-01-28 19:19:03 +000023" Only when the +eval feature is present.
Bram Moolenaar89b10422016-07-12 22:51:22 +020024if 1
Bram Moolenaar11e79bb2017-07-08 17:03:21 +020025 " Make sure the .Xauthority file can be found after changing $HOME.
26 if $XAUTHORITY == ''
27 let $XAUTHORITY = $HOME . '/.Xauthority'
28 endif
29
Bram Moolenaar6a8691d2017-09-03 14:31:02 +020030 " Avoid storing shell history.
31 let $HISTFILE = ""
32
Christian Brabandtb8b1c8e2023-06-23 22:23:01 +010033 " Have current $HOME available as $ORIGHOME. $HOME is used for option
34 " defaults before we get here, and test_mksession checks that.
35 let $ORIGHOME = $HOME
36
John M Devin5b9237c2024-09-08 20:00:38 +020037 if !exists('$XDG_CONFIG_HOME')
38 let $XDG_CONFIG_HOME = $HOME .. '/.config'
39 endif
40
Bram Moolenaar89b10422016-07-12 22:51:22 +020041 " Make sure $HOME does not get read or written.
Bram Moolenaard1ee0042017-07-29 20:39:53 +020042 " It must exist, gnome tries to create $HOME/.gnome2
43 let $HOME = getcwd() . '/XfakeHOME'
Bram Moolenaard0b6c6c2017-07-30 13:28:23 +020044 if !isdirectory($HOME)
45 call mkdir($HOME)
46 endif
Bram Moolenaar89b10422016-07-12 22:51:22 +020047endif