To: vim_dev@googlegroups.com Subject: Patch 9.0.0545 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0545 Problem: When a test is slow and CI times out there is no time info. Solution: Add the elapsed time to the "Executing" message. Files: src/testdir/runtest.vim, src/testdir/Makefile *** ../vim-9.0.0544/src/testdir/runtest.vim 2022-09-20 15:10:27.606001812 +0100 --- src/testdir/runtest.vim 2022-09-22 15:10:37.712606922 +0100 *************** *** 173,183 **** return lnum - top - 1 endfunc func RunTheTest(test) ! echoconsole 'Executing ' . a:test if has('reltime') ! let func_start = reltime() endif " Avoid stopping at the "hit enter" prompt set nomore --- 173,187 ---- return lnum - top - 1 endfunc + let g:func_start = reltime() + func RunTheTest(test) ! let prefix = '' if has('reltime') ! let prefix = 'took ' .. reltimestr(reltime(g:func_start)) .. '; now ' ! let g:func_start = reltime() endif + echoconsole prefix .. 'Executing ' .. a:test " Avoid stopping at the "hit enter" prompt set nomore *************** *** 292,298 **** let message = 'Executed ' . a:test if has('reltime') let message ..= repeat(' ', 50 - len(message)) ! let time = reltime(func_start) if reltimefloat(time) > 0.1 let message = s:t_bold .. message endif --- 296,302 ---- let message = 'Executed ' . a:test if has('reltime') let message ..= repeat(' ', 50 - len(message)) ! let time = reltime(g:func_start) if reltimefloat(time) > 0.1 let message = s:t_bold .. message endif *** ../vim-9.0.0544/src/testdir/Makefile 2022-06-28 11:37:30.000000000 +0100 --- src/testdir/Makefile 2022-09-22 15:07:40.528273156 +0100 *************** *** 12,18 **** # Comment out this line to see the verbose output of tests. # # Catches SwapExists to avoid hanging at the ATTENTION prompt. ! REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' | LC_ALL=C LANG=C LANGUAGE=C awk '/Executing Test_/{match($$0, "Executing Test_[^\\)]*\\)"); print substr($$0, RSTART, RLENGTH) "\r"; fflush()}' # Uncomment this line to use valgrind for memory leaks and extra warnings. # The output goes into a file "valgrind.testN" --- 12,18 ---- # Comment out this line to see the verbose output of tests. # # Catches SwapExists to avoid hanging at the ATTENTION prompt. ! REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' | LC_ALL=C LANG=C LANGUAGE=C awk '/Executing Test_/{match($$0, "(took .*; now )?Executing Test_[^\\)]*\\)"); print substr($$0, RSTART, RLENGTH) "\r"; fflush()}' # Uncomment this line to use valgrind for memory leaks and extra warnings. # The output goes into a file "valgrind.testN" *************** *** 20,25 **** --- 20,28 ---- # This will make testing about 10 times as slow. # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=35 --log-file=valgrind.$* + # To execute one test, e.g. in gdb, use something like this: + # run -f -u unix.vim --gui-dialog-file guidialog -U NONE --noplugin --not-a-term -S runtest.vim test_name.vim + default: nongui # The list of tests is common to all systems. *** ../vim-9.0.0544/src/version.c 2022-09-22 13:57:29.075199731 +0100 --- src/version.c 2022-09-22 15:12:09.028736134 +0100 *************** *** 701,702 **** --- 701,704 ---- { /* Add new patch number below this line */ + /**/ + 545, /**/ -- In a world without fences, who needs Gates and Windows? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///