annotate src/testdir/test_gui_init.vim @ 11028:4df1647531a6 v8.0.0403

patch 8.0.0403: GUI tests may fail commit https://github.com/vim/vim/commit/24d7636e98b33ec6873c51fc72f6bf4b10188d8b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 4 13:32:10 2017 +0100 patch 8.0.0403: GUI tests may fail Problem: GUI tests may fail. Solution: Ignore the E285 error better. (Kazunobu Kuriyama)
author Christian Brabandt <cb@256bit.org>
date Sat, 04 Mar 2017 13:45:04 +0100
parents 4e2cdce4576c
children d8a550329a97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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