comparison src/testdir/runtest.vim @ 19687:c3f506e24eab v8.2.0400

patch 8.2.0400: not all tests using a terminal are in the list of flaky tests Commit: https://github.com/vim/vim/commit/3cdcb090a664e182078f7cc0ca3e4e5a94bbb784 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 18 19:18:10 2020 +0100 patch 8.2.0400: not all tests using a terminal are in the list of flaky tests Problem: Not all tests using a terminal are in the list of flaky tests. Solution: Introduce the test_is_flaky flag.
author Bram Moolenaar <Bram@vim.org>
date Wed, 18 Mar 2020 19:30:04 +0100
parents aae19dd172c0
children e73167dd8cac
comparison
equal deleted inserted replaced
19686:a042d32afa7d 19687:c3f506e24eab
377 \ 'Test_timer_with_partial_callback()', 377 \ 'Test_timer_with_partial_callback()',
378 \ 'Test_zero_reply()', 378 \ 'Test_zero_reply()',
379 \ 'Test_zz1_terminal_in_gui()', 379 \ 'Test_zz1_terminal_in_gui()',
380 \ ] 380 \ ]
381 381
382 " Pattern indicating a common flaky test failure.
383 let s:flaky_errors_re = 'StopVimInTerminal\|VerifyScreenDump'
384
385 " Locate Test_ functions and execute them. 382 " Locate Test_ functions and execute them.
386 redir @q 383 redir @q
387 silent function /^Test_ 384 silent function /^Test_
388 redir END 385 redir END
389 let s:tests = split(substitute(@q, '\(function\|def\) \(\k*()\)', '\2', 'g')) 386 let s:tests = split(substitute(@q, '\(function\|def\) \(\k*()\)', '\2', 'g'))
408 set belloff=all 405 set belloff=all
409 let prev_error = '' 406 let prev_error = ''
410 let total_errors = [] 407 let total_errors = []
411 let run_nr = 1 408 let run_nr = 1
412 409
410 " A test can set test_is_flaky to retry running the test.
411 let test_is_flaky = 0
412
413 call RunTheTest(s:test) 413 call RunTheTest(s:test)
414 414
415 " Repeat a flaky test. Give up when: 415 " Repeat a flaky test. Give up when:
416 " - it fails again with the same message 416 " - it fails again with the same message
417 " - it fails five times (with a different message) 417 " - it fails five times (with a different message)
418 if len(v:errors) > 0 418 if len(v:errors) > 0
419 \ && (index(s:flaky_tests, s:test) >= 0 419 \ && (index(s:flaky_tests, s:test) >= 0
420 \ || v:errors[0] =~ s:flaky_errors_re) 420 \ || test_is_flaky)
421 while 1 421 while 1
422 call add(s:messages, 'Found errors in ' . s:test . ':') 422 call add(s:messages, 'Found errors in ' . s:test . ':')
423 call extend(s:messages, v:errors) 423 call extend(s:messages, v:errors)
424 424
425 call add(total_errors, 'Run ' . run_nr . ':') 425 call add(total_errors, 'Run ' . run_nr . ':')