Mercurial > vim
annotate src/testdir/test_gui_init.vim @ 10944:4e2cdce4576c v8.0.0361
patch 8.0.0361: GUI initialisation is not sufficiently tested
commit https://github.com/vim/vim/commit/8be2fbb6705dfb41d06d688701803d206c968404
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 23 19:32:47 2017 +0100
patch 8.0.0361: GUI initialisation is not sufficiently tested
Problem: GUI initialisation is not sufficiently tested.
Solution: Add the gui_init test. (Kazuki Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 Feb 2017 19:45:04 +0100 |
parents | |
children | 4df1647531a6 |
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 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 " Make sure that the tests will be done with the GUI activated. |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 gui -f |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 func Test_set_guiheadroom() |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 let skipped = '' |
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 if !g:x11_based_gui |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 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
|
26 else |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 " 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
|
28 " gui_init.vim. |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call assert_equal(0, &guiheadroom) |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 endif |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 if !empty(skipped) |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 throw skipped |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 endif |
4e2cdce4576c
patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 endfunc |