From 13c2d3f213201b2fb778f8f39cd3ec0d98b65bb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Sun, 29 Jun 2008 15:21:00 +0200
Subject: [PATCH] Added a fallback for present_n().

Rev: lib/modules/Tools.pmod/Shoot.pmod/module.pmod:1.21
---
 lib/modules/Tools.pmod/Shoot.pmod/module.pmod | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/modules/Tools.pmod/Shoot.pmod/module.pmod b/lib/modules/Tools.pmod/Shoot.pmod/module.pmod
index c3dd453c59..1686a9fce4 100644
--- a/lib/modules/Tools.pmod/Shoot.pmod/module.pmod
+++ b/lib/modules/Tools.pmod/Shoot.pmod/module.pmod
@@ -130,16 +130,15 @@ class ExecTest(string id,Test test)
 
       if (silent) return 0;
 
-      write("%6.3fs %6.3fs %s %5s%s\n",
+      write("%6.3fs %6.3fs %s %5s (%s)\n",
 	    tseconds,
 	    useconds,
 	    memusage>0 ? sprintf("%5dkb", memusage/1024) : "   ?   ",
-	    "("+nruns+")",
-	    test->present_n
-	    ?" ("+(tg != 0.0
-		   ?test->present_n(testntot,nruns,truns,tg,memusage)
-		   :"no time?")+")"
-	    :"");
+	    "(" + nruns + ")",
+	    (tg == 0.0)?"no time?":
+	    test->present_n?test->present_n(testntot,nruns,truns,tg,memusage):
+	    sprintf("%d%s/s", (int)((testntot || nruns)/tg),
+		    testntot?"":" runs"));
       return 0;
    }
 }
-- 
GitLab