Skip to content

Commit 7b666c7

Browse files
committed
patch 8.1.2089: do not get a hint that $TEST_FILTER was active
Problem: Do not get a hint that $TEST_FILTER was active. Solution: Mention $TEST_FILTER if no functions were executed.
1 parent 383f387 commit 7b666c7

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/testdir/runtest.vim

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,18 @@ func FinishTesting()
253253
endif
254254

255255
if s:done == 0
256-
let message = 'NO tests executed'
256+
if s:filtered > 0
257+
let message = "NO tests match $TEST_FILTER: '" .. $TEST_FILTER .. "'"
258+
else
259+
let message = 'NO tests executed'
260+
endif
257261
else
262+
if s:filtered > 0
263+
call add(s:messages, "Filtered " .. s:filtered .. " tests with $TEST_FILTER")
264+
endif
258265
let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')
259266
endif
260-
if has('reltime')
267+
if s:done > 0 && has('reltime')
261268
let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds'
262269
endif
263270
echo message
@@ -386,8 +393,11 @@ endif
386393

387394
" If the environment variable $TEST_FILTER is set then filter the function
388395
" names against it.
396+
let s:filtered = 0
389397
if $TEST_FILTER != ''
398+
let s:filtered = len(s:tests)
390399
let s:tests = filter(s:tests, 'v:val =~ $TEST_FILTER')
400+
let s:filtered -= len(s:tests)
391401
endif
392402

393403
" Execute the tests in alphabetical order.

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,8 @@ static char *(features[]) =
757757

758758
static int included_patches[] =
759759
{ /* Add new patch number below this line */
760+
/**/
761+
2089,
760762
/**/
761763
2088,
762764
/**/

0 commit comments

Comments
 (0)