Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library runtime_configuration; | 5 library runtime_configuration; |
| 6 | 6 |
| 7 import 'compiler_configuration.dart' show CommandArtifact; | 7 import 'compiler_configuration.dart' show CommandArtifact; |
| 8 | 8 |
| 9 // TODO(ahe): Remove this import, we can precompute all the values required | 9 // TODO(ahe): Remove this import, we can precompute all the values required |
| 10 // from TestSuite once the refactoring is complete. | 10 // from TestSuite once the refactoring is complete. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 case 'd8': | 42 case 'd8': |
| 43 return new D8RuntimeConfiguration(); | 43 return new D8RuntimeConfiguration(); |
| 44 | 44 |
| 45 case 'none': | 45 case 'none': |
| 46 return new NoneRuntimeConfiguration(); | 46 return new NoneRuntimeConfiguration(); |
| 47 | 47 |
| 48 case 'vm': | 48 case 'vm': |
| 49 return new StandaloneDartRuntimeConfiguration(); | 49 return new StandaloneDartRuntimeConfiguration(); |
| 50 | 50 |
| 51 case 'dart_product': | |
| 52 return new DartProductRuntimeConfiguration(); | |
| 53 | |
| 54 case 'dart_precompiled': | 51 case 'dart_precompiled': |
| 55 return new DartPrecompiledRuntimeConfiguration(); | 52 return new DartPrecompiledRuntimeConfiguration(); |
| 56 | 53 |
| 57 case 'drt': | 54 case 'drt': |
| 58 return new DrtRuntimeConfiguration(); | 55 return new DrtRuntimeConfiguration(); |
| 59 | 56 |
| 60 default: | 57 default: |
| 61 throw "Unknown runtime '$runtime'"; | 58 throw "Unknown runtime '$runtime'"; |
| 62 } | 59 } |
| 63 } | 60 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 } | 208 } |
| 212 String executable = suite.configuration['noopt'] | 209 String executable = suite.configuration['noopt'] |
| 213 ? suite.dartVmNooptBinaryFileName | 210 ? suite.dartVmNooptBinaryFileName |
| 214 : suite.dartVmBinaryFileName; | 211 : suite.dartVmBinaryFileName; |
| 215 return <Command>[ | 212 return <Command>[ |
| 216 commandBuilder.getVmCommand(executable, arguments, environmentOverrides) | 213 commandBuilder.getVmCommand(executable, arguments, environmentOverrides) |
| 217 ]; | 214 ]; |
| 218 } | 215 } |
| 219 } | 216 } |
| 220 | 217 |
| 221 class DartProductRuntimeConfiguration extends DartVmRuntimeConfiguration { | |
| 222 List<Command> computeRuntimeCommands( | |
| 223 TestSuite suite, | |
| 224 CommandBuilder commandBuilder, | |
| 225 CommandArtifact artifact, | |
| 226 List<String> arguments, | |
| 227 Map<String, String> environmentOverrides) { | |
| 228 String script = artifact.filename; | |
| 229 String type = artifact.mimeType; | |
| 230 if (script != null && type != 'application/dart-snapshot') { | |
| 231 throw "dart_product cannot run files of type '$type'."; | |
| 232 } | |
| 233 | |
| 234 var augmentedArgs = new List(); | |
| 235 augmentedArgs.add("--run-full-snapshot=${artifact.filename}"); | |
|
Cutch
2016/04/19 19:19:28
In product mode the test harness builds a full sna
Florian Schneider
2016/04/19 20:12:42
Oops. Yes, restored with using 'dart' as a binary.
| |
| 236 augmentedArgs.addAll(arguments); | |
| 237 | |
| 238 return <Command>[ | |
| 239 commandBuilder.getVmCommand(suite.dartVmProductBinaryFileName, | |
| 240 augmentedArgs, environmentOverrides) | |
| 241 ]; | |
| 242 } | |
| 243 } | |
| 244 | |
| 245 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration { | 218 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 246 List<Command> computeRuntimeCommands( | 219 List<Command> computeRuntimeCommands( |
| 247 TestSuite suite, | 220 TestSuite suite, |
| 248 CommandBuilder commandBuilder, | 221 CommandBuilder commandBuilder, |
| 249 CommandArtifact artifact, | 222 CommandArtifact artifact, |
| 250 List<String> arguments, | 223 List<String> arguments, |
| 251 Map<String, String> environmentOverrides) { | 224 Map<String, String> environmentOverrides) { |
| 252 String script = artifact.filename; | 225 String script = artifact.filename; |
| 253 String type = artifact.mimeType; | 226 String type = artifact.mimeType; |
| 254 if (script != null && type != 'application/dart-precompiled') { | 227 if (script != null && type != 'application/dart-precompiled') { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 272 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { | 245 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 273 List<Command> computeRuntimeCommands( | 246 List<Command> computeRuntimeCommands( |
| 274 TestSuite suite, | 247 TestSuite suite, |
| 275 CommandBuilder commandBuilder, | 248 CommandBuilder commandBuilder, |
| 276 CommandArtifact artifact, | 249 CommandArtifact artifact, |
| 277 List<String> arguments, | 250 List<String> arguments, |
| 278 Map<String, String> environmentOverrides) { | 251 Map<String, String> environmentOverrides) { |
| 279 throw "Unimplemented runtime '$runtimeType'"; | 252 throw "Unimplemented runtime '$runtimeType'"; |
| 280 } | 253 } |
| 281 } | 254 } |
| OLD | NEW |