aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorprollings <patrickrollings@gmail.com>2016-07-20 15:40:04 +1000
committerJustin M. Keyes <justinkz@gmail.com>2016-07-20 01:40:04 -0400
commit7563972fd9d89fcce4bab183694ab16efef122c0 (patch)
tree0eaa9608c6eb82487d4d67ef23f531f1cb2e1c92 /src/nvim/testdir
parent92866042d9da660913e34ab6d34b25bac8ba3e9b (diff)
downloadrneovim-7563972fd9d89fcce4bab183694ab16efef122c0.tar.gz
rneovim-7563972fd9d89fcce4bab183694ab16efef122c0.tar.bz2
rneovim-7563972fd9d89fcce4bab183694ab16efef122c0.zip
vim-patch:7.4.1365 (#5037)
Problem: Cannot execute a single test function. Solution: Add an argument to filter the functions with. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/runtest.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index 1b1f5d7688..74bbf418fa 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -2,6 +2,11 @@
" When the script is successful the .res file will be created.
" Errors are appended to the test.log file.
"
+" To execute only specific test functions, add a second argument. It will be
+" matched against the names of the Test_ function. E.g.:
+" ../vim -u NONE -S runtest.vim test_channel.vim open_delay
+" The output can be found in the "messages" file.
+"
" The test script may contain anything, only functions that start with
" "Test_" are special. These will be invoked and should contain assert
" functions. See test_assert.vim for an example.
@@ -68,6 +73,11 @@ silent function /^Test_
redir END
let tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g'))
+" If there is an extra argument filter the function names against it.
+if argc() > 1
+ let tests = filter(tests, 'v:val =~ argv(1)')
+endif
+
" Execute the tests in alphabetical order.
for test in sort(tests)
echo 'Executing ' . test