annotate runtime/syntax/tap.vim @ 19849:2ddc553ce412

Added tag v8.2.0480 for changeset 36d629aa3d6e5ad3db9cb06ca02e95ce00c0565e
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 Mar 2020 21:45:04 +0200
parents d91cf2e26ef0
children d1fe80fb35e6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim syntax file
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Language: Verbose TAP Output
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Maintainer: Rufus Cable <rufus@threebytesfull.com>
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Remark: Simple syntax highlighting for TAP output
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 " License:
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " Copyright: (c) 2008-2013 Rufus Cable
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " Last Change: 2014-12-13
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 if exists("b:current_syntax")
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 finish
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 endif
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 syn match tapTestFile /\w\+\/[^. ]*/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 syn match tapTestPlan /^ *\d\+\.\.\d\+$/
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 " tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 " tapTestLine is the line without the ok/not ok status - i.e. number and
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 " optional message
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 " turn ok/not ok messages green/red respectively
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 syn match tapTestStatusOK /ok/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 syn match tapTestStatusNotOK /not ok/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 " highlight todo tests
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 syn match tapTestTodoRev /\<TODO\>/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 " highlight skipped tests
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 " look behind so "ok 123" and "not ok 124" match test number
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 syn match tapTestThreeStars /\*\*\*/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 set foldtext=TAPTestLine_foldtext()
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 function! TAPTestLine_foldtext()
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 let line = getline(v:foldstart)
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 return sub
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 endfunction
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 set foldminlines=5
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 set foldcolumn=2
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 set foldenable
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 set foldmethod=syntax
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 syn sync fromstart
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 if !exists("did_tapverboseoutput_syntax_inits")
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 let did_tapverboseoutput_syntax_inits = 1
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 hi tapTestStatusOK term=bold ctermfg=green guifg=Green
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 hi tapTestTime term=bold ctermfg=blue guifg=Blue
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 hi link tapTestFileWithDot tapTestLoadedFile
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 hi link tapTestNumber Number
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 hi link tapTestDiag Comment
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 hi tapTestRegion ctermbg=green
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 hi tapTestResultsOKRegion ctermbg=green ctermfg=black
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 endif
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 let b:current_syntax="tapVerboseOutput"