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 #2695)
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 0d53a75..dd71745 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -384,6 +384,12 @@
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!