diff options
Diffstat (limited to 'src/nvim/testdir/runtest.vim')
-rw-r--r-- | src/nvim/testdir/runtest.vim | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 65329b58f8..6f039509f3 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -35,8 +35,11 @@ if &lines < 24 || &columns < 80 echoerr error split test.log $put =error - w - cquit + write + split messages + call append(line('$'), error) + write + qa! endif " Common with all tests on all systems. @@ -121,7 +124,10 @@ func RunTheTest(test) exe 'call ' . a:test else try + let s:test = a:test + au VimLeavePre * call EarlyExit(s:test) exe 'call ' . a:test + au! VimLeavePre catch /^\cskipped/ call add(s:messages, ' Skipped') call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', '')) @@ -175,6 +181,15 @@ func AfterTheTest() endif endfunc +func EarlyExit(test) + " It's OK for the test we use to test the quit detection. + if a:test != 'Test_zz_quit_detected()' + call add(v:errors, 'Test caused Vim to exit: ' . a:test) + endif + + call FinishTesting() +endfunc + " This function can be called by a test if it wants to abort testing. func FinishTesting() call AfterTheTest() |