blob: 48dbd85396f9074767fe55df8d6387779bd394a3 [file] [log] [blame]
Bram Moolenaarb46fecd2019-06-15 17:58:09 +02001" Command to check for the presence of a feature.
2command -nargs=1 CheckFeature call CheckFeature(<f-args>)
3func CheckFeature(name)
4 if !has(a:name)
5 throw 'Skipped: ' .. a:name .. ' feature missing'
6 endif
7endfunc
8
9" Command to check for the presence of a working option.
10command -nargs=1 CheckOption call CheckOption(<f-args>)
11func CheckOption(name)
12 if !exists('+' .. a:name)
13 throw 'Skipped: ' .. a:name .. ' option not supported'
14 endif
15endfunc
16
17" Command to check for the presence of a function.
18command -nargs=1 CheckFunction call CheckFunction(<f-args>)
19func CheckFunction(name)
20 if !exists('*' .. a:name)
21 throw 'Skipped: ' .. a:name .. ' function missing'
22 endif
23endfunc
Bram Moolenaar4641a122019-07-29 22:10:23 +020024
25" Command to check for running on MS-Windows
26command CheckMSWindows call CheckMSWindows()
27func CheckMSWindows()
28 if !has('win32')
29 throw 'Skipped: only works on MS-Windows'
30 endif
31endfunc
32
33" Command to check for running on Unix
34command CheckUnix call CheckUnix()
35func CheckUnix()
36 if !has('unix')
37 throw 'Skipped: only works on Unix'
38 endif
39endfunc