Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: editor/tools/plugins/com.google.dart.command.analyze/src/com/google/dart/command/analyze/BatchRunner.java

Issue 12438007: Updates to the new analyzer to help make the try bot happy. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.command.analyze/src/com/google/dart/command/analyze/BatchRunner.java
===================================================================
--- editor/tools/plugins/com.google.dart.command.analyze/src/com/google/dart/command/analyze/BatchRunner.java (revision 19891)
+++ editor/tools/plugins/com.google.dart.command.analyze/src/com/google/dart/command/analyze/BatchRunner.java (working copy)
@@ -23,7 +23,7 @@
*/
class BatchRunner {
- interface BatchRunnerInvocation {
+ public interface BatchRunnerInvocation {
public ErrorSeverity invoke(String[] args) throws Throwable;
}
@@ -33,7 +33,7 @@
*
* @param batchArgs command line arguments forwarded from main().
*/
- public static void runAsBatch(String[] batchArgs, BatchRunnerInvocation toolInvocation)
+ public static ErrorSeverity runAsBatch(String[] batchArgs, BatchRunnerInvocation toolInvocation)
throws Throwable {
System.out.println(">>> BATCH START");
@@ -42,23 +42,23 @@
long startTime = System.currentTimeMillis();
int testsFailed = 0;
int totalTests = 0;
-
+ ErrorSeverity batchResult = ErrorSeverity.NONE;
try {
String line;
-
for (; (line = cmdlineReader.readLine()) != null; totalTests++) {
long testStart = System.currentTimeMillis();
String[] args = line.trim().split("\\s+");
ErrorSeverity result = toolInvocation.invoke(args);
- if (result.equals(ErrorSeverity.ERROR)) {
+ boolean resultPass = !result.equals(ErrorSeverity.ERROR);
+ if (resultPass) {
testsFailed++;
}
-
+ batchResult = batchResult.max(result);
// Write stderr end token and flush.
System.err.println(">>> EOF STDERR");
System.err.flush();
- System.out.println(">>> TEST " + (result.equals(ErrorSeverity.ERROR) ? "FAIL" : "PASS")
- + " " + (System.currentTimeMillis() - testStart) + "ms");
+ System.out.println(">>> TEST " + (resultPass ? "PASS" : "FAIL") + " "
+ + (System.currentTimeMillis() - testStart) + "ms");
System.out.flush();
}
} catch (Throwable e) {
@@ -70,10 +70,9 @@
}
long elapsed = System.currentTimeMillis() - startTime;
-
System.out.println(">>> BATCH END (" + (totalTests - testsFailed) + "/" + totalTests + ") "
+ elapsed + "ms");
System.out.flush();
+ return batchResult;
}
-
}

Powered by Google App Engine
This is Rietveld 408576698