Make mochitest print the amount of time each test takes. (Bug 482162) r=ted
authorL. David Baron <dbaron@dbaron.org>
Tue, 08 Jun 2010 18:44:31 -0700
changeset 43350 1f7ffae6e51e04c54b78a73433abe134709a147e
parent 43349 e5dd52dd3cb54a2f3b3315347f23f35c86d7b2f6
child 43351 396aec61ada24c2de120588911ea61fc0d393cc7
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs482162
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Make mochitest print the amount of time each test takes. (Bug 482162) r=ted
testing/mochitest/tests/SimpleTest/TestRunner.js
--- a/testing/mochitest/tests/SimpleTest/TestRunner.js
+++ b/testing/mochitest/tests/SimpleTest/TestRunner.js
@@ -176,19 +176,22 @@ TestRunner.runNextTest = function() {
             TestRunner.onComplete();
     }
 };
 
 /**
  * This stub is called by SimpleTest when a test is finished.
 **/
 TestRunner.testFinished = function(tests) {
-    if (TestRunner.logEnabled)
-        TestRunner.logger.debug("SimpleTest finished " +
-                                TestRunner._urls[TestRunner._currentTest]);
+    if (TestRunner.logEnabled) {
+        var runtime = new Date().valueOf() - TestRunner._currentTestStartTime;
+        TestRunner.logger.log("SimpleTest finished " +
+                              TestRunner._urls[TestRunner._currentTest] +
+                              " in " + runtime + "ms");
+    }
 
     TestRunner.updateUI(tests);
     TestRunner._currentTest++;
     TestRunner.runNextTest();
 };
 
 /**
  * Get the results.