]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.1033: not easy to read the test time in the test output v8.2.1033
authorBram Moolenaar <Bram@vim.org>
Sun, 21 Jun 2020 18:39:37 +0000 (20:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 21 Jun 2020 18:39:37 +0000 (20:39 +0200)
Problem:    Not easy to read the test time in the test output.
Solution:   Align the times.  Make slow tests bold.

src/testdir/runtest.vim
src/version.c

index b1e05288b118154bd4f81782de3c68f1e896029d..fdf99ce1afc1ff9c550327ac9eefc39552183867 100644 (file)
@@ -216,7 +216,15 @@ func RunTheTest(test)
 
   let message = 'Executed ' . a:test
   if has('reltime')
-    let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
+    let message ..= repeat(' ', 50 - len(message))
+    let time = reltime(func_start)
+    if has('float') && reltimefloat(time) > 0.1
+      let message = &t_md .. message
+    endif
+    let message ..= ' in ' .. reltimestr(time) .. ' seconds'
+    if has('float') && reltimefloat(time) > 0.1
+      let message ..= &t_me
+    endif
   endif
   call add(s:messages, message)
   let s:done += 1
@@ -284,7 +292,9 @@ func FinishTesting()
     let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')
   endif
   if s:done > 0 && has('reltime')
+    let message = &t_md .. message .. repeat(' ', 40 - len(message))
     let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds'
+    let message ..= &t_me
   endif
   echo message
   call add(s:messages, message)
index 5463b44c0001c82fa0a98506ddccb709e26af717..283c0c98994ce86d6fea6b518bef779132a33297 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1033,
 /**/
     1032,
 /**/