aboutsummaryrefslogtreecommitdiffstats
path: root/ddms/libs
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@android.com>2013-01-07 11:27:32 -0800
committerBrett Chabot <brettchabot@android.com>2013-01-07 11:51:00 -0800
commit57c517981cce7c25ef6b805fb36986fdd89e6c46 (patch)
tree593b4595b4de70b32a339cd468f75337f7597344 /ddms/libs
parent4d69200e272697b788963c7f516d868c95d22634 (diff)
downloadsdk-57c517981cce7c25ef6b805fb36986fdd89e6c46.zip
sdk-57c517981cce7c25ef6b805fb36986fdd89e6c46.tar.gz
sdk-57c517981cce7c25ef6b805fb36986fdd89e6c46.tar.bz2
Add test duration to XmlTestRunListener.java
Change-Id: Iebc611a252f09e116fc0c94eddb5156b2c74aa12
Diffstat (limited to 'ddms/libs')
-rw-r--r--ddms/libs/ddmlib/src/main/java/com/android/ddmlib/testrunner/XmlTestRunListener.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/ddms/libs/ddmlib/src/main/java/com/android/ddmlib/testrunner/XmlTestRunListener.java b/ddms/libs/ddmlib/src/main/java/com/android/ddmlib/testrunner/XmlTestRunListener.java
index 2e48afe..27ba476 100644
--- a/ddms/libs/ddmlib/src/main/java/com/android/ddmlib/testrunner/XmlTestRunListener.java
+++ b/ddms/libs/ddmlib/src/main/java/com/android/ddmlib/testrunner/XmlTestRunListener.java
@@ -36,9 +36,6 @@ import java.util.TimeZone;
* Writes JUnit results to an XML files in a format consistent with
* Ant's XMLJUnitResultFormatter.
* <p/>
- * Unlike Ant's formatter, this class does not report the execution time of
- * tests.
- * <p/>
* Creates a separate XML file per test run.
* <p/>
*/
@@ -211,7 +208,8 @@ public class XmlTestRunListener implements ITestRunListener {
serializer.startTag(ns, TESTCASE);
serializer.attribute(ns, ATTR_NAME, testId.getTestName());
serializer.attribute(ns, ATTR_CLASSNAME, testId.getClassName());
- serializer.attribute(ns, ATTR_TIME, "0");
+ long elapsedTimeMs = testResult.getEndTime() - testResult.getStartTime();
+ serializer.attribute(ns, ATTR_TIME, Long.toString(elapsedTimeMs));
if (!TestStatus.PASSED.equals(testResult.getStatus())) {
String result = testResult.getStatus().equals(TestStatus.FAILURE) ? FAILURE : ERROR;