diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/testdir/runtest.vim | 43 | ||||
| -rw-r--r-- | src/nvim/version.c | 2 | 
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 63acd22514..685a2a843b 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -966,7 +966,7 @@ static int included_patches[] = {    1480,    1479,    1478, -  // 1477, +  1477,    // 1476 NA    // 1475 NA    // 1474 NA | 
