]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1365 v7.4.1365
authorBram Moolenaar <Bram@vim.org>
Sat, 20 Feb 2016 13:41:40 +0000 (14:41 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 20 Feb 2016 13:41:40 +0000 (14:41 +0100)
Problem:    Cannot execute a single test function.
Solution:   Add an argument to filter the functions with. (Yasuhiro Matsumoto)

src/testdir/runtest.vim
src/version.c

index 2d5e21c9276360981f7ab17c3f7bfd0a883f5844..469a4d38555d92752f3cd50f7ac6f89eded38571 100644 (file)
@@ -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_ funtion.  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.
@@ -94,6 +99,11 @@ silent function /^Test_
 redir END
 let s:tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g'))
 
+" If there is an extra argument filter the function names against it.
+if argc() > 1
+  let s:tests = filter(s:tests, 'v:val =~ argv(1)')
+endif
+
 " Execute the tests in alphabetical order.
 for s:test in sort(s:tests)
   echo 'Executing ' . s:test
index 38d6a1d56b4b7f8c622062f8cf57d5f331ba43b4..b3a9eec1a09b1552e4627f2accb6b9d27bfa0641 100644 (file)
@@ -747,6 +747,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1365,
 /**/
     1364,
 /**/