summaryrefslogtreecommitdiffstats
path: root/src/testdir/runtest.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-08-07 17:20:16 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-07 17:20:16 +0200
commitdae453f3397a26a53301d7327e6ed43e8b392035 (patch)
tree1b1581368cbfb4f1fe86cb39d84e4b8bf6bae7aa /src/testdir/runtest.vim
parent4270d8b7626ff8a7006f6a09c89bc446a3f89d1e (diff)
patch 8.2.3311: Vim9: check for DO_NOT_FREE_CNT is very slowv8.2.3311
Problem: Vim9: check for DO_NOT_FREE_CNT is very slow. Solution: Move to a separate function so it can be skipped by setting $TEST_SKIP_PAT.
Diffstat (limited to 'src/testdir/runtest.vim')
-rw-r--r--src/testdir/runtest.vim17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index e43dd8d944..2ef0f554fe 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -13,6 +13,9 @@
" For csh:
" setenv TEST_FILTER Test_channel
"
+" If the environment variable $TEST_SKIP_PAT is set then test functions
+" matching this pattern will be skipped. It's the opposite of $TEST_FILTER.
+"
" While working on a test you can make $TEST_NO_RETRY non-empty to not retry:
" export TEST_NO_RETRY=yes
"
@@ -329,13 +332,17 @@ func FinishTesting()
if s:done == 0
if s:filtered > 0
- let message = "NO tests match $TEST_FILTER: '" .. $TEST_FILTER .. "'"
+ if $TEST_FILTER != ''
+ let message = "NO tests match $TEST_FILTER: '" .. $TEST_FILTER .. "'"
+ else
+ let message = "ALL tests match $TEST_SKIP_PAT: '" .. $TEST_SKIP_PAT .. "'"
+ endif
else
let message = 'NO tests executed'
endif
else
if s:filtered > 0
- call add(s:messages, "Filtered " .. s:filtered .. " tests with $TEST_FILTER")
+ call add(s:messages, "Filtered " .. s:filtered .. " tests with $TEST_FILTER and $TEST_SKIP_PAT")
endif
let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')
endif
@@ -461,6 +468,12 @@ endif
" Execute the tests in alphabetical order.
for g:testfunc in sort(s:tests)
+ if $TEST_SKIP_PAT != '' && g:testfunc =~ $TEST_SKIP_PAT
+ call add(s:messages, g:testfunc .. ' matches $TEST_SKIP_PAT')
+ let s:filtered += 1
+ continue
+ endif
+
" Silence, please!
set belloff=all
let prev_error = ''