blob: ecc8fc9efe5067fd59a84b667a212bae1d2f435c [file] [log] [blame]
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +01001" Tests specifically for the GUI features/options that need to be set up at
2" startup to take effect at runtime.
3
Bram Moolenaar9f0139a2017-08-13 20:26:20 +02004source shared.vim
5if !CanRunGui()
Bram Moolenaarb46fecd2019-06-15 17:58:09 +02006 throw 'Skipped: cannot run GUI'
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +01007endif
8
9source setup_gui.vim
10
11func Setup()
12 call GUISetUpCommon()
13endfunc
14
15func TearDown()
16 call GUITearDownCommon()
17endfunc
18
Bram Moolenaar24d76362017-03-04 13:32:10 +010019" Ignore the "failed to create input context" error.
Bram Moolenaar5d7ead32018-02-27 17:17:42 +010020call test_ignore_error('E285:')
Bram Moolenaar24d76362017-03-04 13:32:10 +010021
22" Start the GUI now, in the foreground.
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010023gui -f
24
25func Test_set_guiheadroom()
26 let skipped = ''
27
28 if !g:x11_based_gui
29 let skipped = g:not_supported . 'guiheadroom'
30 else
31 " The 'expected' value must be consistent with the value specified with
32 " gui_init.vim.
33 call assert_equal(0, &guiheadroom)
34 endif
35
36 if !empty(skipped)
37 throw skipped
38 endif
39endfunc
Bram Moolenaar87748452017-03-12 17:10:33 +010040
41func Test_set_guioptions_for_M()
42 sleep 200ms
43 " Check if the 'M' option is included.
44 call assert_match('.*M.*', &guioptions)
45endfunc
46
47func Test_set_guioptions_for_p()
48 let skipped = ''
49
50 if !g:x11_based_gui
51 let skipped = g:not_supported . '''p'' of guioptions'
52 else
53 sleep 200ms
54 " Check if the 'p' option is included.
55 call assert_match('.*p.*', &guioptions)
56 endif
57
58 if !empty(skipped)
59 throw skipped
60 endif
61endfunc