summaryrefslogtreecommitdiff
path: root/src/testdir/runtest.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-11-17 17:56:13 +0100
committerBram Moolenaar <Bram@vim.org>2016-11-17 17:56:13 +0100
commitcc28e2d05d05552d8b72a520be8a193f3d9822d4 (patch)
tree10636aea7b16c817cb42d82d306dafc79e636ce1 /src/testdir/runtest.vim
parent7df915d113ac1981792c50e8b000c9f5f784b78b (diff)
downloadvim-git-cc28e2d05d05552d8b72a520be8a193f3d9822d4.tar.gz
patch 8.0.0088v8.0.0088
Problem: When a test fails in Setup or Teardown the problem is not reported. Solution: Add a try/catch. (Hirohito Higashi)
Diffstat (limited to 'src/testdir/runtest.vim')
-rw-r--r--src/testdir/runtest.vim14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index c4cb84732..3ba3b0264 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -89,7 +89,11 @@ endfunc
function RunTheTest(test)
echo 'Executing ' . a:test
if exists("*SetUp")
- call SetUp()
+ try
+ call SetUp()
+ catch
+ call add(v:errors, 'Caught exception in SetUp() before ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
+ endtry
endif
call add(s:messages, 'Executing ' . a:test)
@@ -104,7 +108,11 @@ function RunTheTest(test)
endtry
if exists("*TearDown")
- call TearDown()
+ try
+ call TearDown()
+ catch
+ call add(v:errors, 'Caught exception in TearDown() after ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
+ endtry
endif
" Close any extra windows and make the current one not modified.
@@ -221,3 +229,5 @@ call append(line('$'), s:messages)
write
qall!
+
+" vim: shiftwidth=2 sts=2 expandtab