summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/testdir/runtest.vim12
-rw-r--r--src/testdir/test_assert.vim6
-rw-r--r--src/version.c2
3 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 5b8126d5d1..4f508a4875 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -124,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\+', '', ''))
@@ -174,6 +177,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()
diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim
index 61147286fb..28db289b2a 100644
--- a/src/testdir/test_assert.vim
+++ b/src/testdir/test_assert.vim
@@ -198,3 +198,9 @@ func Test_user_is_happy()
smile
sleep 300m
endfunc
+
+" Must be last.
+func Test_zz_quit_detected()
+ " Verify that if a test function ends Vim the test script detects this.
+ quit
+endfunc
diff --git a/src/version.c b/src/version.c
index 100506b0b1..dfdc07d59f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 44,
+/**/
43,
/**/
42,