Mercurial > vim
annotate src/testdir/test_gui_init.vim @ 11119:d8a550329a97 v8.0.0447
patch 8.0.0447: getting font name does not work on X11
commit https://github.com/vim/vim/commit/8774845ce1a7def122ea07c057a79417f3be3d17
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 12 17:10:33 2017 +0100
patch 8.0.0447: getting font name does not work on X11
Problem: Getting font name does not work on X11.
Solution: Implement gui_mch_get_fontname() for X11. Add more GUI tests.
(Kazunobu Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Mar 2017 17:15:04 +0100 |
parents | 4df1647531a6 |
children | d2c20ec4b95a |
rev | line source |
---|---|
10944
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests specifically for the GUI features/options that need to be set up at |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 " startup to take effect at runtime. |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 if !has('gui') || ($DISPLAY == "" && !has('gui_running')) |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 finish |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 endif |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 source setup_gui.vim |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 func Setup() |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call GUISetUpCommon() |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 endfunc |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 func TearDown() |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call GUITearDownCommon() |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 endfunc |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 |
11028
4df1647531a6
patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents:
10944
diff
changeset
|
18 " Ignore the "failed to create input context" error. |
4df1647531a6
patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents:
10944
diff
changeset
|
19 call test_ignore_error('E285') |
4df1647531a6
patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents:
10944
diff
changeset
|
20 |
4df1647531a6
patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents:
10944
diff
changeset
|
21 " Start the GUI now, in the foreground. |
10944
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 gui -f |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 func Test_set_guiheadroom() |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 let skipped = '' |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 if !g:x11_based_gui |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 let skipped = g:not_supported . 'guiheadroom' |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 else |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 " The 'expected' value must be consistent with the value specified with |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 " gui_init.vim. |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal(0, &guiheadroom) |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 endif |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 if !empty(skipped) |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 throw skipped |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 endif |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 endfunc |
11119
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
39 |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
40 func Test_set_guioptions_for_M() |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
41 sleep 200ms |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
42 " Check if the 'M' option is included. |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
43 call assert_match('.*M.*', &guioptions) |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
44 endfunc |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
45 |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
46 func Test_set_guioptions_for_p() |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
47 let skipped = '' |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
48 |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
49 if !g:x11_based_gui |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
50 let skipped = g:not_supported . '''p'' of guioptions' |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
51 else |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
52 sleep 200ms |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
53 " Check if the 'p' option is included. |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
54 call assert_match('.*p.*', &guioptions) |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
55 endif |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
56 |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
57 if !empty(skipped) |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
58 throw skipped |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
59 endif |
d8a550329a97
patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents:
11028
diff
changeset
|
60 endfunc |