mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.2087: cannot easily select one test function to execute
Problem: Cannot easily select one test function to execute.
Solution: Support the $TEST_FILTER environment variable. (Ozaki Kiichi,
closes vim/vim#2695)
a7f6c3cf07
This commit is contained in:
parent
34a59242a0
commit
74e37ac665
@ -319,6 +319,12 @@ if argc() > 1
|
|||||||
let s:tests = filter(s:tests, 'v:val =~ argv(1)')
|
let s:tests = filter(s:tests, 'v:val =~ argv(1)')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" If the environment variable $TEST_FILTER is set then filter the function
|
||||||
|
" names against it.
|
||||||
|
if $TEST_FILTER != ''
|
||||||
|
let s:tests = filter(s:tests, 'v:val =~ $TEST_FILTER')
|
||||||
|
endif
|
||||||
|
|
||||||
" Execute the tests in alphabetical order.
|
" Execute the tests in alphabetical order.
|
||||||
for s:test in sort(s:tests)
|
for s:test in sort(s:tests)
|
||||||
" Silence, please!
|
" Silence, please!
|
||||||
|
@ -8,7 +8,7 @@ if 1
|
|||||||
let g:failed += a:match+0
|
let g:failed += a:match+0
|
||||||
elseif a:type ==# 'skipped'
|
elseif a:type ==# 'skipped'
|
||||||
let g:skipped += 1
|
let g:skipped += 1
|
||||||
call extend(g:skipped_output, ["\t".a:match])
|
call extend(g:skipped_output, ["\t" .. a:match])
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -19,6 +19,10 @@ if 1
|
|||||||
let g:failed_output = []
|
let g:failed_output = []
|
||||||
let output = [""]
|
let output = [""]
|
||||||
|
|
||||||
|
if $TEST_FILTER != ''
|
||||||
|
call extend(g:skipped_output, ["\tAll tests not matching $TEST_FILTER: '" .. $TEST_FILTER .. "'"])
|
||||||
|
endif
|
||||||
|
|
||||||
try
|
try
|
||||||
" This uses the :s command to just fetch and process the output of the
|
" This uses the :s command to just fetch and process the output of the
|
||||||
" tests, it doesn't actually replace anything.
|
" tests, it doesn't actually replace anything.
|
||||||
|
Loading…
Reference in New Issue
Block a user