OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 package com.google.dart.corelib; | 5 package com.google.dart.corelib; |
6 | 6 |
7 import com.google.dart.compiler.CommandLineOptions.CompilerOptions; | 7 import com.google.dart.compiler.CommandLineOptions.CompilerOptions; |
8 import com.google.dart.compiler.CompilerConfiguration; | 8 import com.google.dart.compiler.CompilerConfiguration; |
9 import com.google.dart.compiler.DartArtifactProvider; | 9 import com.google.dart.compiler.DartArtifactProvider; |
10 import com.google.dart.compiler.DartCompilationError; | 10 import com.google.dart.compiler.DartCompilationError; |
11 import com.google.dart.compiler.DartCompiler; | 11 import com.google.dart.compiler.DartCompiler; |
12 import com.google.dart.compiler.DartCompilerListener; | 12 import com.google.dart.compiler.DartCompilerListener; |
13 import com.google.dart.compiler.DefaultCompilerConfiguration; | 13 import com.google.dart.compiler.DefaultCompilerConfiguration; |
14 import com.google.dart.compiler.DefaultDartArtifactProvider; | 14 import com.google.dart.compiler.DefaultDartArtifactProvider; |
15 import com.google.dart.compiler.DefaultLibrarySource; | 15 import com.google.dart.compiler.DefaultLibrarySource; |
16 import com.google.dart.compiler.LibrarySource; | 16 import com.google.dart.compiler.LibrarySource; |
17 import com.google.dart.compiler.Source; | 17 import com.google.dart.compiler.Source; |
18 import com.google.dart.compiler.UrlLibrarySource; | 18 import com.google.dart.compiler.UrlLibrarySource; |
| 19 import com.google.dart.runner.DartRunner; |
19 import com.google.dart.runner.RunnerError; | 20 import com.google.dart.runner.RunnerError; |
20 import com.google.dart.runner.TestRunner; | |
21 import com.google.dart.runner.V8Launcher; | 21 import com.google.dart.runner.V8Launcher; |
22 | 22 |
23 import junit.framework.AssertionFailedError; | 23 import junit.framework.AssertionFailedError; |
24 import junit.framework.Test; | 24 import junit.framework.Test; |
25 import junit.framework.TestCase; | 25 import junit.framework.TestCase; |
26 import junit.framework.TestSuite; | 26 import junit.framework.TestSuite; |
27 | 27 |
28 import org.kohsuke.args4j.CmdLineException; | 28 import org.kohsuke.args4j.CmdLineException; |
29 import org.kohsuke.args4j.CmdLineParser; | 29 import org.kohsuke.args4j.CmdLineParser; |
30 | 30 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 @Override | 132 @Override |
133 public void runBare() { | 133 public void runBare() { |
134 assertTrue(V8Launcher.isConfigured()); | 134 assertTrue(V8Launcher.isConfigured()); |
135 ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); | 135 ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); |
136 PrintStream outputStream = new PrintStream(byteOutput); | 136 PrintStream outputStream = new PrintStream(byteOutput); |
137 try { | 137 try { |
138 if (regularCompile) { | 138 if (regularCompile) { |
139 invokeCompiler(); | 139 invokeCompiler(); |
140 } else { | 140 } else { |
141 TestRunner.throwingMain(arguments, outputStream, outputStream); | 141 DartRunner.throwingMain(arguments, outputStream, outputStream); |
142 } | 142 } |
143 } catch (RunnerError e) { | 143 } catch (RunnerError e) { |
144 outputStream.close(); | 144 outputStream.close(); |
145 analyzeError(e, byteOutput.toString()); | 145 analyzeError(e, byteOutput.toString()); |
146 return; | 146 return; |
147 } catch (Throwable t) { | 147 } catch (Throwable t) { |
148 outputStream.close(); | 148 outputStream.close(); |
149 analyzeCrash(t); | 149 analyzeCrash(t); |
150 return; | 150 return; |
151 } | 151 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 String[] fields = SEPARATOR.split(line); | 285 String[] fields = SEPARATOR.split(line); |
286 assertTrue(line, fields.length > 3); | 286 assertTrue(line, fields.length > 3); |
287 String name = fields[0]; | 287 String name = fields[0]; |
288 Set<String> outcomes = new HashSet<String>(Arrays.<String>asList(fields[1].s
plit(","))); | 288 Set<String> outcomes = new HashSet<String>(Arrays.<String>asList(fields[1].s
plit(","))); |
289 boolean isNegative = fields[2].equals("True"); | 289 boolean isNegative = fields[2].equals("True"); |
290 String[] arguments = new String[fields.length - 3]; | 290 String[] arguments = new String[fields.length - 3]; |
291 System.arraycopy(fields, 3, arguments, 0, arguments.length); | 291 System.arraycopy(fields, 3, arguments, 0, arguments.length); |
292 return new SharedTestCase(name, outcomes, isNegative, regularCompile, argume
nts); | 292 return new SharedTestCase(name, outcomes, isNegative, regularCompile, argume
nts); |
293 } | 293 } |
294 } | 294 } |
OLD | NEW |