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

Unified Diff: compiler/javatests/com/google/dart/compiler/CompilerTestCase.java

Issue 9969043: Adds Junit tests in dartc back into test.py (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Some Junit tests have broken in interleaving patches Created 8 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
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
index 2ad25036ce06f5ac07732dcc86a5953f7c08add2..bd889915085607a2e8d2751fb19afd37a6118bba 100644
--- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
@@ -28,6 +28,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -249,6 +250,25 @@ public abstract class CompilerTestCase extends TestCase {
listener.checkAllErrorsReported();
return unit;
}
+
+ protected DartUnit parseUnitAsSystemLibrary (final String srcName, String sourceCode,
+ Object... errors) {
+ DartSourceTest src = new DartSourceTest(srcName, sourceCode, null) {
+ @Override
+ public URI getUri() {
+ try {
+ return new URI("dart:core/" + srcName);
scheglov 2012/04/01 18:52:52 May be URI.create(String) and remove try/catch?
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ DartCompilerListenerTest listener = new DartCompilerListenerTest(srcName, errors);
+ ParserContext context = makeParserContext(src, sourceCode, listener);
+ DartUnit unit = makeParser(context).parseUnit(src);
+ listener.checkAllErrorsReported();
+ return unit;
+ }
/**
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698