aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-18 18:29:51 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-10-18 18:30:20 +0800
commit09fb243bdd0c2cde76e360bb98118932fda5d77b (patch)
treeeef9986bd937fbd072ad6fc44eb489a6ba4ec994
parent9e3640a7797bcc5f6015548842572a6ce951a861 (diff)
downloadrneovim-09fb243bdd0c2cde76e360bb98118932fda5d77b.tar.gz
rneovim-09fb243bdd0c2cde76e360bb98118932fda5d77b.tar.bz2
rneovim-09fb243bdd0c2cde76e360bb98118932fda5d77b.zip
vim-patch:9.0.2045: tests: checking for swap files takes time
Problem: tests: checking for swap files takes time Solution: don't check for swap files when test has been skipped Check for swap files takes a considerable about of time, so don't do that for skipped tests to avoid wasting time. closes: vim/vim#13371 https://github.com/vim/vim/commit/a0e1f06f04da3444e278ddf47e2ea3d5857a7dec
-rw-r--r--test/old/testdir/runtest.vim22
1 files changed, 14 insertions, 8 deletions
diff --git a/test/old/testdir/runtest.vim b/test/old/testdir/runtest.vim
index 6be6fd0fd3..97ef96424a 100644
--- a/test/old/testdir/runtest.vim
+++ b/test/old/testdir/runtest.vim
@@ -231,6 +231,8 @@ func RunTheTest(test)
endtry
endif
+ let skipped = v:false
+
au VimLeavePre * call EarlyExit(g:testfunc)
if a:test =~ 'Test_nocatch_'
" Function handles errors itself. This avoids skipping commands after the
@@ -240,6 +242,7 @@ func RunTheTest(test)
if g:skipped_reason != ''
call add(s:messages, ' Skipped')
call add(s:skipped, 'SKIPPED ' . a:test . ': ' . g:skipped_reason)
+ let skipped = v:true
endif
else
try
@@ -247,6 +250,7 @@ func RunTheTest(test)
catch /^\cskipped/
call add(s:messages, ' Skipped')
call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', ''))
+ let skipped = v:true
catch
call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
endtry
@@ -342,14 +346,16 @@ func RunTheTest(test)
endif
endwhile
- " Check if the test has left any swap files behind. Delete them before
- " running tests again, they might interfere.
- let swapfiles = s:GetSwapFileList()
- if len(swapfiles) > 0
- call add(s:messages, "Found swap files: " .. string(swapfiles))
- for name in swapfiles
- call delete(name)
- endfor
+ if !skipped
+ " Check if the test has left any swap files behind. Delete them before
+ " running tests again, they might interfere.
+ let swapfiles = s:GetSwapFileList()
+ if len(swapfiles) > 0
+ call add(s:messages, "Found swap files: " .. string(swapfiles))
+ for name in swapfiles
+ call delete(name)
+ endfor
+ endif
endif
endfunc