diff options
Diffstat (limited to 'src/nvim/testdir/runtest.vim')
-rw-r--r-- | src/nvim/testdir/runtest.vim | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 593ce6fcdc..2bf61b0719 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -44,6 +44,10 @@ if &lines < 24 || &columns < 80 qa! endif +if has('reltime') + let s:start_time = reltime() +endif + " Common with all tests on all systems. source setup.vim @@ -80,6 +84,11 @@ let &runtimepath .= ','.expand($BUILD_DIR).'/runtime/' " Always use forward slashes. set shellslash +if has('win32') + " avoid prompt that is long or contains a line break + let $PROMPT = '$P$G' +endif + " Prepare for calling test_garbagecollect_now(). let v:testing = 1 @@ -98,13 +107,11 @@ func GetAllocId(name) return lnum - top - 1 endfunc -func CanRunVimInTerminal() - " Nvim: always false, we use Lua screen-tests instead. - return 0 -endfunc - func RunTheTest(test) echo 'Executing ' . a:test + if has('reltime') + let func_start = reltime() + endif " Avoid stopping at the "hit enter" prompt set nomore @@ -129,7 +136,11 @@ func RunTheTest(test) endtry endif - call add(s:messages, 'Executing ' . a:test) + let message = 'Executed ' . a:test + if has('reltime') + let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds' + endif + call add(s:messages, message) let s:done += 1 if a:test =~ 'Test_nocatch_' @@ -235,6 +246,9 @@ func FinishTesting() else let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test') endif + if has('reltime') + let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds' + endif echo message call add(s:messages, message) if s:fail > 0 @@ -282,18 +296,23 @@ endif " Names of flaky tests. let s:flaky_tests = [ + \ 'Test_autocmd_SafeState()', \ 'Test_cursorhold_insert()', \ 'Test_exit_callback_interval()', \ 'Test_map_timeout_with_timer_interrupt()', \ 'Test_oneshot()', \ 'Test_out_cb()', \ 'Test_paused()', + \ 'Test_popup_and_window_resize()', \ 'Test_quoteplus()', \ 'Test_quotestar()', \ 'Test_reltime()', \ 'Test_repeat_many()', \ 'Test_repeat_three()', + \ 'Test_state()', \ 'Test_stop_all_in_callback()', + \ 'Test_term_mouse_double_click_to_create_tab', + \ 'Test_term_mouse_multiple_clicks_to_visually_select()', \ 'Test_terminal_composing_unicode()', \ 'Test_terminal_redir_file()', \ 'Test_terminal_tmap()', @@ -314,6 +333,12 @@ if argc() > 1 let s:tests = filter(s:tests, 'v:val =~ argv(1)') endif +" If the environment variable $TEST_FILTER is set then filter the function +" names against it. +if $TEST_FILTER != '' + let s:tests = filter(s:tests, 'v:val =~ $TEST_FILTER') +endif + " Execute the tests in alphabetical order. for s:test in sort(s:tests) " Silence, please! |