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