OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.native_test; | 5 package org.chromium.native_test; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.app.Instrumentation; | 8 import android.app.Instrumentation; |
9 import android.content.ComponentName; | 9 import android.content.ComponentName; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 Matcher m = RE_TEST_OUTPUT.matcher(l); | 120 Matcher m = RE_TEST_OUTPUT.matcher(l); |
121 if (m.matches()) { | 121 if (m.matches()) { |
122 if (m.group(1).equals("RUN")) { | 122 if (m.group(1).equals("RUN")) { |
123 results.put(m.group(2), TestResult.UNKNOWN); | 123 results.put(m.group(2), TestResult.UNKNOWN); |
124 } else if (m.group(1).equals("FAILED")) { | 124 } else if (m.group(1).equals("FAILED")) { |
125 results.put(m.group(2), TestResult.FAILED); | 125 results.put(m.group(2), TestResult.FAILED); |
126 } else if (m.group(1).equals("OK")) { | 126 } else if (m.group(1).equals("OK")) { |
127 results.put(m.group(2), TestResult.PASSED); | 127 results.put(m.group(2), TestResult.PASSED); |
128 } | 128 } |
129 } | 129 } |
130 resultsStr.append(l); | 130 mLogBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, l
+ "\n"); |
131 resultsStr.append("\n"); | 131 sendStatus(0, mLogBundle); |
132 } | 132 } |
133 mLogBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, result
sStr.toString()); | |
134 sendStatus(0, mLogBundle); | |
135 } catch (InterruptedException e) { | 133 } catch (InterruptedException e) { |
136 Log.e(TAG, "Interrupted while waiting for FIFO file creation: " + e.
toString()); | 134 Log.e(TAG, "Interrupted while waiting for FIFO file creation: " + e.
toString()); |
137 } catch (FileNotFoundException e) { | 135 } catch (FileNotFoundException e) { |
138 Log.e(TAG, "Couldn't find FIFO file: " + e.toString()); | 136 Log.e(TAG, "Couldn't find FIFO file: " + e.toString()); |
139 } catch (IOException e) { | 137 } catch (IOException e) { |
140 Log.e(TAG, "Error handling FIFO file: " + e.toString()); | 138 Log.e(TAG, "Error handling FIFO file: " + e.toString()); |
141 } finally { | 139 } finally { |
142 if (r != null) { | 140 if (r != null) { |
143 try { | 141 try { |
144 r.close(); | 142 r.close(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 "\nFAILURES!!! Tests run: " + Integer.toString(rawResult
s.size()) | 185 "\nFAILURES!!! Tests run: " + Integer.toString(rawResult
s.size()) |
188 + ", Failures: " + Integer.toString(testsFailed) + ", Er
rors: 0"); | 186 + ", Failures: " + Integer.toString(testsFailed) + ", Er
rors: 0"); |
189 } | 187 } |
190 resultsBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, | 188 resultsBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, |
191 resultBuilder.toString()); | 189 resultBuilder.toString()); |
192 return resultsBundle; | 190 return resultsBundle; |
193 } | 191 } |
194 } | 192 } |
195 | 193 |
196 } | 194 } |
OLD | NEW |