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

Unified Diff: compiler/javatests/com/google/dart/corelib/SharedTestCase.java

Issue 8395013: DartC User Warning Framework (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use new ErrorCode enums in single onError() method. Created 9 years, 2 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: compiler/javatests/com/google/dart/corelib/SharedTestCase.java
diff --git a/compiler/javatests/com/google/dart/corelib/SharedTestCase.java b/compiler/javatests/com/google/dart/corelib/SharedTestCase.java
index ee74c8f4346e1a1cc6fb50b6472c14064b43535a..ccdec9144cf2b80b554cce0044b1781bec2bfbac 100644
--- a/compiler/javatests/com/google/dart/corelib/SharedTestCase.java
+++ b/compiler/javatests/com/google/dart/corelib/SharedTestCase.java
@@ -14,8 +14,10 @@ import com.google.dart.compiler.DartCompilerListener;
import com.google.dart.compiler.DefaultCompilerConfiguration;
import com.google.dart.compiler.DefaultDartArtifactProvider;
import com.google.dart.compiler.DefaultLibrarySource;
+import com.google.dart.compiler.ErrorSeverity;
import com.google.dart.compiler.LibrarySource;
import com.google.dart.compiler.Source;
+import com.google.dart.compiler.SubSystem;
import com.google.dart.compiler.UrlLibrarySource;
import com.google.dart.runner.DartRunner;
import com.google.dart.runner.RunnerError;
@@ -218,8 +220,14 @@ public class SharedTestCase extends TestCase {
private DartCompilerListener getListener() {
DartCompilerListener listener = new DartCompilerListener() {
@Override
- public void compilationError(DartCompilationError event) {
- compilationErrorCount.incrementAndGet();
+ public void onError(DartCompilationError event) {
+ if (event.getErrorCode().getSubSystem() == SubSystem.STATIC_TYPE) {
+ typeErrorCount.incrementAndGet();
+ } else if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.ERROR) {
+ compilationErrorCount.incrementAndGet();
+ } else if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.WARNING) {
+ warningCount.incrementAndGet();
+ }
maybeThrow(event);
}
@@ -234,18 +242,6 @@ public class SharedTestCase extends TestCase {
}
@Override
- public void compilationWarning(DartCompilationError event) {
- warningCount.incrementAndGet();
- maybeThrow(event);
- }
-
- @Override
- public void typeError(DartCompilationError event) {
- typeErrorCount.incrementAndGet();
- maybeThrow(event);
- }
-
- @Override
public void unitCompiled(DartUnit unit) {
}
};

Powered by Google App Engine
This is Rietveld 408576698