]> granicus.if.org Git - vim/commitdiff
patch 8.1.2089: do not get a hint that $TEST_FILTER was active v8.1.2089
authorBram Moolenaar <Bram@vim.org>
Fri, 27 Sep 2019 19:25:00 +0000 (21:25 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 27 Sep 2019 19:25:00 +0000 (21:25 +0200)
Problem:    Do not get a hint that $TEST_FILTER was active.
Solution:   Mention $TEST_FILTER if no functions were executed.

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

index dd717450e4d6a8b2af30aff02f6ee8bba0380c2f..e1ea7f1e68abcb72e0326124ee0b76c292bba804 100644 (file)
@@ -253,11 +253,18 @@ func FinishTesting()
   endif
 
   if s:done == 0
-    let message = 'NO tests executed'
+    if s:filtered > 0
+      let message = "NO tests match $TEST_FILTER: '" .. $TEST_FILTER .. "'"
+    else
+      let message = 'NO tests executed'
+    endif
   else
+    if s:filtered > 0
+      call add(s:messages, "Filtered " .. s:filtered .. " tests with $TEST_FILTER")
+    endif
     let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')
   endif
-  if has('reltime')
+  if s:done > 0 && has('reltime')
     let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds'
   endif
   echo message
@@ -386,8 +393,11 @@ endif
 
 " If the environment variable $TEST_FILTER is set then filter the function
 " names against it.
+let s:filtered = 0
 if $TEST_FILTER != ''
+  let s:filtered = len(s:tests)
   let s:tests = filter(s:tests, 'v:val =~ $TEST_FILTER')
+  let s:filtered -= len(s:tests)
 endif
 
 " Execute the tests in alphabetical order.
index 35253eb43af5e36d40bc1c97310c9dafd3b41610..552f82a7007dc226cdf366d4b7aafc0e1c17b70c 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2089,
 /**/
     2088,
 /**/