1-
2-
31let s: vimlparser = vimlparser#import ()
42
53let s: sdir = expand (' <sfile>:p:h' )
64
75function ! s: run ()
6+ enew
7+ set buftype = nofile
8+ let ng = 0
89 for vimfile in glob (s: sdir . ' /test*.vim' , 0 , 1 )
910 let okfile = fnamemodify (vimfile, ' :r' ) . ' .ok'
1011 let outfile = fnamemodify (vimfile, ' :r' ) . ' .out'
12+ let skip = filereadable (fnamemodify (vimfile, ' :r' ) . ' .skip' )
1113 let src = readfile (vimfile)
1214 let r = s: vimlparser .StringReader.new (src )
1315 if vimfile = ~# ' test_neo'
@@ -23,13 +25,28 @@ function! s:run()
2325 catch
2426 call writefile ([v: exception ], outfile)
2527 endtry
26- if system (printf (' diff %s %s' , shellescape (okfile), shellescape (outfile))) == " "
28+ let diff = system (printf (' diff -u %s %s' , shellescape (okfile), shellescape (outfile)))
29+ if empty (diff )
2730 let line = printf (' %s => ok' , fnamemodify (vimfile, ' :.' ))
31+ call append (line (' $' ), line )
2832 else
29- let line = printf (' %s => ng' , fnamemodify (vimfile, ' :.' ))
33+ if ! skip
34+ let ng += 1
35+ endif
36+ let line = printf (' %s => ' . (skip ? ' skip' : ' ng' ), fnamemodify (vimfile, ' :.' ))
37+ call append (line (' $' ), line )
38+ for line in split (diff , ' \n' )
39+ call append (line (' $' ), ' ' . line )
40+ endfor
3041 endif
31- call append (line (' $' ), line )
3242 endfor
43+ if $CI == ' true'
44+ call writefile (getline (1 , ' $' ), ' test.log' )
45+ if ng == 0
46+ quit !
47+ endif
48+ cquit !
49+ endif
3350 syntax enable
3451 match Error /^.* => ng$/
3552endfunction
0 commit comments