aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick <patrick@bitscope.com>2016-07-11 19:01:22 +1000
committerPatrick <patrick@bitscope.com>2016-08-04 13:29:29 +1000
commita4cb500d988bd294375d497b56977271c7e08615 (patch)
tree1e9113906f5fd382df76cf243b680d553235dbbd /src
parent08d11bd42f3cacc66f3d6097ff18c50059079f14 (diff)
downloadrneovim-a4cb500d988bd294375d497b56977271c7e08615.tar.gz
rneovim-a4cb500d988bd294375d497b56977271c7e08615.tar.bz2
rneovim-a4cb500d988bd294375d497b56977271c7e08615.zip
vim-patch:7.4.1477
Problem: Test_reltime is flaky, it depends on timing. Solution: When it fails run it a second time. https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/runtest.vim43
-rw-r--r--src/nvim/version.c2
2 files changed, 29 insertions, 16 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index 74bbf418fa..f9b5be1c81 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -47,6 +47,25 @@ lang mess C
" Always use forward slashes.
set shellslash
+function RunTheTest(test)
+ echo 'Executing ' . test
+ if exists("*SetUp")
+ call SetUp()
+ endif
+
+ call add(s:messages, 'Executing ' . test)
+ let s:done += 1
+ try
+ exe 'call ' . test
+ catch
+ call add(v:errors, 'Caught exception in ' . test . ': ' . v:exception . ' @ ' . v:throwpoint)
+ endtry
+
+ if exists("*TearDown")
+ call TearDown()
+ endif
+endfunc
+
" Source the test script. First grab the file name, in case the script
" navigates away.
let testname = expand('%')
@@ -66,6 +85,9 @@ else
endtry
endif
+" Names of flaky tests.
+let s:flaky = []
+
" Locate Test_ functions and execute them.
set nomore
redir @q
@@ -80,19 +102,13 @@ endif
" Execute the tests in alphabetical order.
for test in sort(tests)
- echo 'Executing ' . test
- if exists("*SetUp")
- call SetUp()
- endif
+ call RunTheTest(test)
- call add(messages, 'Executing ' . test)
- let done += 1
- try
- exe 'call ' . test
- catch
- let fail += 1
- call add(v:errors, 'Caught exception in ' . test . ': ' . v:exception . ' @ ' . v:throwpoint)
- endtry
+ if len(v:errors) > 0 && index(flaky, test) >= 0
+ call add(messages, 'Flaky test failed, running it again')
+ let v:errors = []
+ call RunTheTest(test)
+ endif
if len(v:errors) > 0
let fail += 1
@@ -101,9 +117,6 @@ for test in sort(tests)
let v:errors = []
endif
- if exists("*TearDown")
- call TearDown()
- endif
endfor
if fail == 0
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 6dcc8f622f..6b189a820f 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -800,7 +800,7 @@ static int included_patches[] = {
1480,
1479,
1478,
- // 1477,
+ 1477,
// 1476 NA
// 1475 NA
// 1474 NA