robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
504d7decbd
master
1" Vim syntax file 2" Language: Verbose TAP Output 3" Maintainer: Rufus Cable <rufus@threebytesfull.com> 4" Remark: Simple syntax highlighting for TAP output 5" License: Vim License (see :help license) 6" Copyright: (c) 2008-2013 Rufus Cable 7" Last Change: 2020 Mar 15 8 9if exists ( "b:current_syntax" ) 10finish 11endif 12 13syn match tapTestDiag /^ * #. * /contains = tapTestTodo 14syn match tapTestTime /^ * \[\d\d:\d\d:\d\d\]. * /contains = tapTestFile 15syn match tapTestFile /\w\+\/ [ ^. ] * /contained 16syn match tapTestFileWithDot /\w\+\/ [ ^ ] * /contained 17 18syn match tapTestPlan /^ * \d\+\.\.\d\+$ / 19 20" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx' 21syn match tapTest /^ * \(not \)\?ok \d\+. * /contains = tapTestStatusOK , tapTestStatusNotOK , tapTestLine 22 23" tapTestLine is the line without the ok/not ok status - i.e. number and 24" optional message 25syn match tapTestLine /\d\+\( . * \|$\) /contains = tapTestNumber , tapTestLoadMessage , tapTestTodo , tapTestSkip contained 26 27" turn ok/not ok messages green/red respectively 28syn match tapTestStatusOK /ok /contained 29syn match tapTestStatusNotOK /not ok /contained 30 31" highlight todo tests 32syn match tapTestTodo /\c\(# TODO\|Failed (TODO)\) . * $ /contained contains = tapTestTodoRev 33syn match tapTestTodoRev /\c\<TODO\> /contained 34 35" highlight skipped tests 36syn match tapTestSkip /\c# skip . * $ /contained contains = tapTestSkipTag 37syn match tapTestSkipTag /\c\(# \)\@<=skip\> /contained 38 39" look behind so "ok 123" and "not ok 124" match test number 40syn match tapTestNumber /\(ok \)\@<=\d\d * /contained 41syn match tapTestLoadMessage /\*\*\*. * \*\*\* /contained contains = tapTestThreeStars , tapTestFileWithDot 42syn match tapTestThreeStars /\*\*\* /contained 43 44syn region tapTestRegion start = /^ * \(not \)\?ok. * $ /me= e+1end = /^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\) /me= s-1fold transparent excludenl 45syn region tapTestResultsOKRegion start = /^\(All tests successful\|Result: PASS\) /end = /$ / 46syn region tapTestResultsNotOKRegion start = /^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\) /end = /$ / 47syn region tapTestResultsSummaryRegion start = /^Test Summary Report /end = /^Files=. * $ /contains = tapTestResultsSummaryHeading , tapTestResultsSummaryNotOK 48 49syn region tapTestResultsSummaryHeading start = /^Test Summary Report /end = /^-\+$ /contained 50syn region tapTestResultsSummaryNotOK start = /TODO passed: /end = /$ /contained 51 52syn region tapTestInstructionsRegion start = /\%1l /end = /^$ / 53 54syn sync fromstart 55 56if ! exists ( "did_tapverboseoutput_syntax_inits" ) 57let did_tapverboseoutput_syntax_inits = 1 58 59hi tapTestStatusOK term = bold ctermfg = green guifg = Green 60hi tapTestStatusNotOK term = reverse ctermfg = black ctermbg = red guifg = Black guibg = Red 61hi tapTestTodo term = bold ctermfg = yellow ctermbg = black guifg = Yellow guibg = Black 62hi tapTestTodoRev term = reverse ctermfg = black ctermbg = yellow guifg = Black guibg = Yellow 63hi tapTestSkip term = bold ctermfg = lightblue guifg = LightBlue 64hi tapTestSkipTag term = reverse ctermfg = black ctermbg = lightblue guifg = Black guibg = LightBlue 65hi tapTestTime term = bold ctermfg = blue guifg = Blue 66hi tapTestFile term = reverse ctermfg = black ctermbg = yellow guibg = Black guifg = Yellow 67hi tapTestLoadedFile term = bold ctermfg = black ctermbg = cyan guibg = Cyan guifg = Black 68hi tapTestThreeStars term = reverse ctermfg = blue guifg = Blue 69hi tapTestPlan term = bold ctermfg = yellow guifg = Yellow 70 71hi link tapTestFileWithDot tapTestLoadedFile 72hi link tapTestNumber Number 73hi link tapTestDiag Comment 74 75hi tapTestRegion ctermbg = green 76 77hi tapTestResultsOKRegion ctermbg = green ctermfg = black 78hi tapTestResultsNotOKRegion ctermbg = red ctermfg = black 79 80hi tapTestResultsSummaryHeading ctermbg = blue ctermfg = white 81hi tapTestResultsSummaryNotOK ctermbg = red ctermfg = black 82 83hi tapTestInstructionsRegion ctermbg = lightmagenta ctermfg = black 84endif 85 86let b: current_syntax = "tapVerboseOutput"