diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:39:54 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:39:54 +0000 |
commit | 21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch) | |
tree | 84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /src/nvim/testdir/summarize.vim | |
parent | d9c904f85a23a496df4eb6be42aa43f007b22d50 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-colorcolchar.tar.gz rneovim-colorcolchar.tar.bz2 rneovim-colorcolchar.zip |
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'src/nvim/testdir/summarize.vim')
-rw-r--r-- | src/nvim/testdir/summarize.vim | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/nvim/testdir/summarize.vim b/src/nvim/testdir/summarize.vim deleted file mode 100644 index da5856a2e7..0000000000 --- a/src/nvim/testdir/summarize.vim +++ /dev/null @@ -1,62 +0,0 @@ -set cpo&vim -if 1 - " This is executed only with the eval feature - set nocompatible - set viminfo= - func Count(match, type) - if a:type ==# 'executed' - let g:executed += (a:match+0) - elseif a:type ==# 'failed' - let g:failed += a:match+0 - elseif a:type ==# 'skipped' - let g:skipped += 1 - call extend(g:skipped_output, ["\t" .. a:match]) - endif - endfunc - - let g:executed = 0 - let g:skipped = 0 - let g:failed = 0 - let g:skipped_output = [] - let g:failed_output = [] - let output = [""] - - if $TEST_FILTER != '' - call extend(g:skipped_output, ["\tAll tests not matching $TEST_FILTER: '" .. $TEST_FILTER .. "'"]) - endif - - try - " This uses the :s command to just fetch and process the output of the - " tests, it doesn't actually replace anything. - " And it uses "silent" to avoid reporting the number of matches. - silent %s/Executed\s\+\zs\d\+\ze\s\+tests\?/\=Count(submatch(0),'executed')/egn - silent %s/^SKIPPED \zs.*/\=Count(submatch(0), 'skipped')/egn - silent %s/^\(\d\+\)\s\+FAILED:/\=Count(submatch(1), 'failed')/egn - - call extend(output, ["Skipped:"]) - call extend(output, skipped_output) - - call extend(output, [ - \ "", - \ "-------------------------------", - \ printf("Executed: %5d Tests", g:executed), - \ printf(" Skipped: %5d Tests", g:skipped), - \ printf(" %s: %5d Tests", g:failed == 0 ? 'Failed' : 'FAILED', g:failed), - \ "", - \ ]) - if filereadable('test.log') - " outputs and indents the failed test result - call extend(output, ["", "Failures: "]) - let failed_output = filter(readfile('test.log'), { v,k -> !empty(k)}) - call extend(output, map(failed_output, { v,k -> "\t".k})) - " Add a final newline - call extend(output, [""]) - endif - - catch " Catch-all - finally - call writefile(output, 'test_result.log') " overwrites an existing file - endtry -endif - -q! |