Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 1 | " Common preparations for running GUI tests. |
| 2 | |
| 3 | let g:x11_based_gui = has('gui_athena') || has('gui_motif') |
| 4 | \ || has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') |
| 5 | |
| 6 | " Reasons for 'skipped'. |
| 7 | let g:not_supported = "Skipped: Feature/Option not supported by this GUI: " |
| 8 | let g:not_implemented = "Skipped: Test not implemented yet for this GUI" |
| 9 | let g:not_hosted = "Skipped: Test not hosted by the system/environment" |
| 10 | |
| 11 | " For KDE set a font, empty 'guifont' may cause a hang. |
| 12 | func GUISetUpCommon() |
| 13 | if has("gui_kde") |
| 14 | set guifont=Courier\ 10\ Pitch/8/-1/5/50/0/0/0/0/0 |
| 15 | endif |
| 16 | |
| 17 | " Gnome insists on creating $HOME/.gnome2/, set $HOME to avoid changing the |
| 18 | " actual home directory. But avoid triggering fontconfig by setting the |
| 19 | " cache directory. Only needed for Unix. |
| 20 | if $XDG_CACHE_HOME == '' && exists('g:tester_HOME') |
| 21 | let $XDG_CACHE_HOME = g:tester_HOME . '/.cache' |
| 22 | endif |
| 23 | call mkdir('Xhome') |
| 24 | let $HOME = fnamemodify('Xhome', ':p') |
| 25 | endfunc |
| 26 | |
| 27 | func GUITearDownCommon() |
| 28 | call delete('Xhome', 'rf') |
| 29 | endfunc |
Bram Moolenaar | f8ab1b1 | 2017-03-01 18:30:34 +0100 | [diff] [blame^] | 30 | |
| 31 | " Ignore the "failed to create input context" error. |
| 32 | call test_ignore_error('E285') |