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