| Index: dart/compiler/javatests/com/google/dart/compiler/end2end/End2EndTestCase.java
|
| diff --git a/dart/compiler/javatests/com/google/dart/compiler/end2end/End2EndTestCase.java b/dart/compiler/javatests/com/google/dart/compiler/end2end/End2EndTestCase.java
|
| index 9b4a7ced253f4c566b3a9aca199698c1ac46c2a6..364bbdcb584f9d36d3ce8b52647ba983ecdcc624 100644
|
| --- a/dart/compiler/javatests/com/google/dart/compiler/end2end/End2EndTestCase.java
|
| +++ b/dart/compiler/javatests/com/google/dart/compiler/end2end/End2EndTestCase.java
|
| @@ -16,30 +16,23 @@ import com.google.dart.compiler.DartSourceTest;
|
| import com.google.dart.compiler.DefaultCompilerConfiguration;
|
| import com.google.dart.compiler.LibrarySource;
|
| import com.google.dart.compiler.MockLibrarySource;
|
| -import com.google.dart.compiler.backend.js.ClosureJsBackend;
|
| import com.google.dart.compiler.backend.js.JavascriptBackend;
|
| import com.google.dart.runner.DartRunner;
|
| import com.google.dart.runner.RunnerError;
|
|
|
| import org.kohsuke.args4j.CmdLineException;
|
| -import org.mozilla.javascript.RhinoException;
|
|
|
| import java.util.List;
|
|
|
| /**
|
| - * Abstract base for end-to-end tests. Tests are entirely Dart code that are compiled and run
|
| - * within Rhino or V8.
|
| + * Abstract base for end-to-end tests. Tests are entirely Dart code
|
| + * that are compiled and run within V8.
|
| *
|
| * TODO(zundel): code generation is being removed. Remove any references to code generation
|
| * or running code.
|
| */
|
| public abstract class End2EndTestCase extends CompilerTestCase {
|
|
|
| - enum OptimizationLevel {
|
| - RAW,
|
| - APP
|
| - }
|
| -
|
| /**
|
| * Creates an ApplicationSource that should be compiled and executed.
|
| *
|
| @@ -59,44 +52,29 @@ public abstract class End2EndTestCase extends CompilerTestCase {
|
| /**
|
| * Creates a compiler configuration appropriate for the optimization level.
|
| */
|
| - CompilerConfiguration getCompilerConfiguration(OptimizationLevel opLevel) {
|
| - switch (opLevel) {
|
| - case RAW:
|
| - return new DefaultCompilerConfiguration(new JavascriptBackend(),
|
| - new CompilerOptions() {
|
| - // TODO(zundel): To be removed when code generation is removed
|
| - @Override
|
| - public boolean checkOnly() {
|
| - return false;
|
| - }
|
| - });
|
| - case APP:
|
| - return new DefaultCompilerConfiguration(new ClosureJsBackend(),
|
| - new CompilerOptions() {
|
| - // TODO(zundel): To be removed when code generation is removed
|
| - @Override
|
| - public boolean checkOnly() {
|
| - return false;
|
| - }
|
| - });
|
| - }
|
| - throw new IllegalStateException("unexpected opLevel");
|
| + CompilerConfiguration getCompilerConfiguration() {
|
| + // TODO(zundel): To be removed when code generation is removed
|
| + return new DefaultCompilerConfiguration(new JavascriptBackend()) {
|
| + @Override
|
| + public boolean checkOnly() {
|
| + return false;
|
| + }
|
| + };
|
| }
|
|
|
| /**
|
| * Runs an end-to-end Dart test for the given compilation unit.
|
| */
|
| @Deprecated
|
| - protected void runTest(LibrarySource app, OptimizationLevel opLevel,
|
| - DartCompilerListener listener) {
|
| - runTest(app, opLevel, listener, new String[0]);
|
| + protected void runTest(LibrarySource app, DartCompilerListener listener) {
|
| + runTest(app, listener, new String[0]);
|
| }
|
|
|
| @Deprecated
|
| - protected void runTest(LibrarySource app, OptimizationLevel opLevel,
|
| + protected void runTest(LibrarySource app,
|
| DartCompilerListener listener, String[] args) {
|
| - final CompilerConfiguration config = getCompilerConfiguration(opLevel);
|
| - runTest(app, opLevel, listener, config, args);
|
| + final CompilerConfiguration config = getCompilerConfiguration();
|
| + runTest(app, listener, config, args);
|
| }
|
|
|
| /**
|
| @@ -104,7 +82,7 @@ public abstract class End2EndTestCase extends CompilerTestCase {
|
| *
|
| */
|
| @Deprecated
|
| - protected void runTest(LibrarySource app, OptimizationLevel opLevel,
|
| + protected void runTest(LibrarySource app,
|
| DartCompilerListener listener,
|
| CompilerConfiguration config, String[] args) {
|
| DartRunnerOptions verboseOptions = new CommandLineOptions.DartRunnerOptions() {
|
| @@ -117,18 +95,6 @@ public abstract class End2EndTestCase extends CompilerTestCase {
|
| try {
|
| DartRunner.compileAndRunApp(app, verboseOptions, config, listener, args,
|
| System.out, System.err);
|
| - } catch (RhinoException e) {
|
| - // TODO(jgw): This is a hack to dump the translated source when something goes wrong. It can
|
| - // be removed as soon as we have a source map we can use to provide source-level errors.
|
| -
|
| - // TODO(floitsch): clean up the exception handling. Who prints what, and when?
|
| -
|
| - StringBuffer msg = new StringBuffer();
|
| - msg.append("optimization level: " + opLevel.toString() + "\n");
|
| - msg.append(e.sourceName());
|
| - msg.append(" (" + e.lineNumber() + ":" + e.columnNumber() + ")");
|
| - msg.append(" : " + e.details());
|
| - fail(msg.toString());
|
| } catch (RunnerError e) {
|
| fail(e.getLocalizedMessage());
|
| }
|
| @@ -137,9 +103,9 @@ public abstract class End2EndTestCase extends CompilerTestCase {
|
| /**
|
| * Runs an end-to-end Dart test for the given compilation unit.
|
| */
|
| - protected void runTest(LibrarySource app, OptimizationLevel opLevel) {
|
| + protected void runTest(LibrarySource app) {
|
| DartCompilerListener listener = new DartCompilerListenerTest(null);
|
| - runTest(app, opLevel, listener);
|
| + runTest(app, listener);
|
| }
|
|
|
| /**
|
| @@ -150,7 +116,6 @@ public abstract class End2EndTestCase extends CompilerTestCase {
|
| CompilerOptions options = processCommandLineOptions(args);
|
| DefaultCompilerConfiguration config = new DefaultCompilerConfiguration(options);
|
| runTest(new DartLibrarySourceTest(getClass(), appSrc),
|
| - OptimizationLevel.RAW,
|
| listener,
|
| config,
|
| args);
|
| @@ -162,14 +127,12 @@ public abstract class End2EndTestCase extends CompilerTestCase {
|
| * @param srcs path to the Dart source files containing the test
|
| * @param opLevel The type of optimization to perform on the test code.
|
| */
|
| - protected void runTest(
|
| - List<String> srcs, OptimizationLevel opLevel)
|
| - throws SecurityException {
|
| - runTest(createApplication(srcs), opLevel);
|
| + protected void runTest(List<String> srcs) throws SecurityException {
|
| + runTest(createApplication(srcs));
|
| }
|
|
|
| protected void runTest(String appSrc) throws Exception {
|
| - runTest(new DartLibrarySourceTest(getClass(), appSrc), OptimizationLevel.RAW);
|
| + runTest(new DartLibrarySourceTest(getClass(), appSrc));
|
| }
|
|
|
| protected static CompilerOptions processCommandLineOptions(String[] args) {
|
|
|