annotate src/testdir/test_compiler.vim @ 18767:068337e86133 v8.1.2373

patch 8.1.2373: cannot build with +popupwin but without +quickfix Commit: https://github.com/vim/vim/commit/5a4c3082d7ab51b3d448a91578479c96c1ab0ad3 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 1 15:23:11 2019 +0100 patch 8.1.2373: cannot build with +popupwin but without +quickfix Problem: Cannot build with +popupwin but without +quickfix. (John Marriott) Solution: Adjust #ifdefs.
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Dec 2019 15:30:04 +0100
parents fc68850c5233
children 2f0f308c069c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test the :compiler command
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
18767
068337e86133 patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18273
diff changeset
3 source check.vim
068337e86133 patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18273
diff changeset
4
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 func Test_compiler()
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 if !executable('perl')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 return
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 endif
18767
068337e86133 patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18273
diff changeset
9 CheckFeature quickfix
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
14260
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
11 " $LANG changes the output of Perl.
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
12 if $LANG != ''
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
13 unlet $LANG
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
14 endif
9ff35e144467 patch 8.1.0146: when $LANG is set the compiler test may fail
Christian Brabandt <cb@256bit.org>
parents: 13974
diff changeset
15
17572
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
16 " %:S does not work properly with 'shellslash' set
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
17 let save_shellslash = &shellslash
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
18 set noshellslash
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
19
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 e Xfoo.pl
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 compiler perl
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal('perl', b:current_compiler)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 call assert_fails('let g:current_compiler', 'E121:')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call setline(1, ['#!/usr/bin/perl -w', 'use strict;', 'my $foo=1'])
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 w!
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call feedkeys(":make\<CR>\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call assert_fails('clist', 'E42:')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call setline(1, ['#!/usr/bin/perl -w', 'use strict;', '$foo=1'])
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 w!
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call feedkeys(":make\<CR>\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 let a=execute('clist')
18118
9b7c7754ba9d patch 8.1.2054: compiler test for Perl may fail
Bram Moolenaar <Bram@vim.org>
parents: 17572
diff changeset
34 call assert_match('\n \d\+ Xfoo.pl:3: Global symbol "$foo" '
9b7c7754ba9d patch 8.1.2054: compiler test for Perl may fail
Bram Moolenaar <Bram@vim.org>
parents: 17572
diff changeset
35 \ . 'requires explicit package name', a)
9b7c7754ba9d patch 8.1.2054: compiler test for Perl may fail
Bram Moolenaar <Bram@vim.org>
parents: 17572
diff changeset
36
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37
17572
0d7c87cad133 patch 8.1.1783: MS-Windows: compiler test may fail when using %:S
Bram Moolenaar <Bram@vim.org>
parents: 14260
diff changeset
38 let &shellslash = save_shellslash
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 call delete('Xfoo.pl')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 bw!
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 endfunc
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 func Test_compiler_without_arg()
18273
fc68850c5233 patch 8.1.2131: MSVC tests fail
Bram Moolenaar <Bram@vim.org>
parents: 18269
diff changeset
44 let runtime = substitute($VIMRUNTIME, '\\', '/', 'g')
fc68850c5233 patch 8.1.2131: MSVC tests fail
Bram Moolenaar <Bram@vim.org>
parents: 18269
diff changeset
45 let a = split(execute('compiler'))
fc68850c5233 patch 8.1.2131: MSVC tests fail
Bram Moolenaar <Bram@vim.org>
parents: 18269
diff changeset
46 call assert_match(runtime .. '/compiler/ant.vim$', a[0])
fc68850c5233 patch 8.1.2131: MSVC tests fail
Bram Moolenaar <Bram@vim.org>
parents: 18269
diff changeset
47 call assert_match(runtime .. '/compiler/bcc.vim$', a[1])
fc68850c5233 patch 8.1.2131: MSVC tests fail
Bram Moolenaar <Bram@vim.org>
parents: 18269
diff changeset
48 call assert_match(runtime .. '/compiler/xmlwf.vim$', a[-1])
13970
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 endfunc
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 func Test_compiler_completion()
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 call assert_match('^"compiler ant bcc .* xmlwf$', @:)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 call assert_equal('"compiler pbx perl php pylint pyunit', @:)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 call feedkeys(":compiler! p\<C-A>\<C-B>\"\<CR>", 'tx')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 call assert_equal('"compiler! pbx perl php pylint pyunit', @:)
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 endfunc
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 func Test_compiler_error()
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 call assert_fails('compiler doesnotexist', 'E666:')
939cfab265b9 patch 8.1.0003: the :compiler command is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 endfunc