diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-12-29 22:42:51 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-12-29 22:43:16 -0500 |
commit | 74e37ac665bf2f5ec5d20f73352972cca8808f04 (patch) | |
tree | 90616e1eea4558fbd079812409a2fc383d8ababa | |
parent | 34a59242a0d42687a49119cca590e7b4203496ef (diff) | |
download | rneovim-74e37ac665bf2f5ec5d20f73352972cca8808f04.tar.gz rneovim-74e37ac665bf2f5ec5d20f73352972cca8808f04.tar.bz2 rneovim-74e37ac665bf2f5ec5d20f73352972cca8808f04.zip |
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)
https://github.com/vim/vim/commit/a7f6c3cf071bb6267e0bd2eb3d27ca240381ba87
-rw-r--r-- | src/nvim/testdir/runtest.vim | 6 | ||||
-rw-r--r-- | src/nvim/testdir/summarize.vim | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 2d4134a644..fd49e48c2d 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -319,6 +319,12 @@ if argc() > 1 let s:tests = filter(s:tests, 'v:val =~ argv(1)') 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. for s:test in sort(s:tests) " Silence, please! diff --git a/src/nvim/testdir/summarize.vim b/src/nvim/testdir/summarize.vim index 5bbf0b338a..9cf3f694ca 100644 --- a/src/nvim/testdir/summarize.vim +++ b/src/nvim/testdir/summarize.vim @@ -8,7 +8,7 @@ if 1 let g:failed += a:match+0 elseif a:type ==# 'skipped' let g:skipped += 1 - call extend(g:skipped_output, ["\t".a:match]) + call extend(g:skipped_output, ["\t" .. a:match]) endif endfunc @@ -19,6 +19,10 @@ if 1 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. |