aboutsummaryrefslogtreecommitdiffstats
path: root/ddms
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@android.com>2010-10-04 16:37:13 -0700
committerBrett Chabot <brettchabot@android.com>2010-10-04 16:37:13 -0700
commit69b73d4b186ad4074a746bafcc425512e050e385 (patch)
tree55d6b9eb3a8d1fa4d12d79e1f0594af1c64d4514 /ddms
parent912cb3fa416757726f008adc8547c872492309cc (diff)
downloadsdk-69b73d4b186ad4074a746bafcc425512e050e385.zip
sdk-69b73d4b186ad4074a746bafcc425512e050e385.tar.gz
sdk-69b73d4b186ad4074a746bafcc425512e050e385.tar.bz2
Fix case where testRunEnded was called twice.
Change-Id: I14be6641c020baf0ad90f2f036e35fb854aed2ab
Diffstat (limited to 'ddms')
-rw-r--r--ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java
index 4819fbc..a986380 100644
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java
+++ b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java
@@ -565,10 +565,19 @@ public class InstrumentationResultParser extends MultiLineReceiver {
@Override
public void done() {
super.done();
- if (!mTestRunFailReported && !mTestStartReported && !mTestRunFinished) {
+ if (!mTestRunFailReported) {
+ handleOutputDone();
+ }
+ }
+
+ /**
+ * Handles the end of the adb session when a test run failure has not been reported yet
+ */
+ private void handleOutputDone() {
+ if (!mTestStartReported && !mTestRunFinished) {
// no results
handleTestRunFailed(NO_TEST_RESULTS_MSG);
- } else if (!mTestRunFailReported && mNumTestsExpected > mNumTestsRun) {
+ } else if (mNumTestsExpected > mNumTestsRun) {
final String message =
String.format("%s. Expected %d tests, received %d",
INCOMPLETE_RUN_ERR_MSG_PREFIX, mNumTestsExpected, mNumTestsRun);