print out test duration, in seconds12/head
authorRyan Davis <ryan@acceleration.net>
Tue, 5 Feb 2013 14:56:42 +0000 (5 09:56 -0500)
committerRyan Davis <ryan@acceleration.net>
Tue, 5 Feb 2013 14:56:42 +0000 (5 09:56 -0500)
extensions/test-anything-protocol.lisp

index d9acbca..09653f8 100644 (file)
 
 (export '(write-tap write-tap-to-file))
 
+(defun run-time-s (test-result)
+  "calculate the run-time of the test in seconds"
+  (/ (run-time test-result)
+     internal-time-units-per-second))
+
 (defun %write-tap-test-result (name test-result i stream)
   "Output a single test, taking care to ensure the indentation level
 is the same before and after invocation."
   (pprint-logical-block (stream nil)
     (format stream
-            "~:[ok~;not ok~] ~d ~s"
+            "~:[ok~;not ok~] ~d ~s (~,2f s)"
             (or (fail test-result)
                 (exerr test-result))
-            i name)
+            i name
+            (run-time-s test-result))
     (when (or (fail test-result)
               (exerr test-result))
       ;; indent only takes affect after a newline, so force one