Patch 9.0.0561
Problem:    When a test gets stuck it just hangs forever.
Solution:   Set a timeout of 30 seconds.
Files:      src/testdir/runtest.vim


*** ../vim-9.0.0560/src/testdir/runtest.vim     2022-09-23 19:42:27.814236815 
+0100
--- src/testdir/runtest.vim     2022-09-23 20:22:57.288376414 +0100
***************
*** 186,191 ****
--- 186,202 ----
    let g:func_start = reltime()
  endif
  
+ " Invoked when a test takes too much time.
+ func TestTimeout(id)
+   split test.log
+   call append(line('$'), '')
+   call append(line('$'), 'Test timed out: ' .. g:testfunc)
+   write
+   call add(v:errors, 'Test timed out: ' . g:testfunc)
+ 
+   cquit! 42
+ endfunc
+ 
  func RunTheTest(test)
    let prefix = ''
    if has('reltime')
***************
*** 194,199 ****
--- 205,216 ----
    endif
    echoconsole prefix .. 'Executing ' .. a:test
  
+   if has('timers')
+     " No test should take longer than 30 seconds.  If it takes longer we
+     " assume we are stuck and need to break out.
+     let test_timeout_timer = timer_start(30000, 'TestTimeout')
+   endif
+ 
    " Avoid stopping at the "hit enter" prompt
    set nomore
  
***************
*** 259,264 ****
--- 276,285 ----
      endtry
    endif
  
+   if has('timers')
+     call timer_stop(test_timeout_timer)
+   endif
+ 
    " Clear any autocommands and put back the catch-all for SwapExists.
    au!
    au SwapExists * call HandleSwapExists()
*** ../vim-9.0.0560/src/version.c       2022-09-23 19:42:27.814236815 +0100
--- src/version.c       2022-09-23 20:23:45.416301530 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     561,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
146. You experience ACTUAL physical withdrawal symptoms when away
     from your 'puter and the net.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220923192747.826AC1C063B%40moolenaar.net.

Raspunde prin e-mail lui