| 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 | 7 import 'compiler_configuration.dart' show |
| 8 CommandArtifact; | 8 CommandArtifact; |
| 9 | 9 |
| 10 // TODO(ahe): Remove this import, we can precompute all the values required | 10 // TODO(ahe): Remove this import, we can precompute all the values required |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 case 'd8': | 46 case 'd8': |
| 47 return new D8RuntimeConfiguration(); | 47 return new D8RuntimeConfiguration(); |
| 48 | 48 |
| 49 case 'none': | 49 case 'none': |
| 50 return new NoneRuntimeConfiguration(); | 50 return new NoneRuntimeConfiguration(); |
| 51 | 51 |
| 52 case 'vm': | 52 case 'vm': |
| 53 return new StandaloneDartRuntimeConfiguration(); | 53 return new StandaloneDartRuntimeConfiguration(); |
| 54 | 54 |
| 55 case 'dart_snapshotted': |
| 56 return new DartSnapshottedRuntimeConfiguration(); |
| 57 |
| 55 case 'dart_precompiled': | 58 case 'dart_precompiled': |
| 56 return new DartPrecompiledRuntimeConfiguration(); | 59 return new DartPrecompiledRuntimeConfiguration(); |
| 57 | 60 |
| 58 case 'drt': | 61 case 'drt': |
| 59 return new DrtRuntimeConfiguration(); | 62 return new DrtRuntimeConfiguration(); |
| 60 | 63 |
| 61 default: | 64 default: |
| 62 throw "Unknown runtime '$runtime'"; | 65 throw "Unknown runtime '$runtime'"; |
| 63 } | 66 } |
| 64 } | 67 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 TestSuite suite, | 214 TestSuite suite, |
| 212 CommandBuilder commandBuilder, | 215 CommandBuilder commandBuilder, |
| 213 CommandArtifact artifact, | 216 CommandArtifact artifact, |
| 214 List<String> arguments, | 217 List<String> arguments, |
| 215 Map<String, String> environmentOverrides) { | 218 Map<String, String> environmentOverrides) { |
| 216 String script = artifact.filename; | 219 String script = artifact.filename; |
| 217 String type = artifact.mimeType; | 220 String type = artifact.mimeType; |
| 218 if (script != null && type != 'application/dart') { | 221 if (script != null && type != 'application/dart') { |
| 219 throw "Dart VM cannot run files of type '$type'."; | 222 throw "Dart VM cannot run files of type '$type'."; |
| 220 } | 223 } |
| 221 String executable = suite.configuration['noopt'] | 224 String executable = suite.configuration['noopt'] |
| 222 ? suite.dartVmNooptBinaryFileName | 225 ? suite.dartVmNooptBinaryFileName |
| 223 : suite.dartVmBinaryFileName; | 226 : suite.dartVmBinaryFileName; |
| 224 return <Command>[commandBuilder.getVmCommand( | 227 return <Command>[commandBuilder.getVmCommand( |
| 225 executable, arguments, environmentOverrides)]; | 228 executable, arguments, environmentOverrides)]; |
| 226 } | 229 } |
| 227 } | 230 } |
| 228 | 231 |
| 232 class DartSnapshottedRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 233 List<Command> computeRuntimeCommands( |
| 234 TestSuite suite, |
| 235 CommandBuilder commandBuilder, |
| 236 CommandArtifact artifact, |
| 237 List<String> arguments, |
| 238 Map<String, String> environmentOverrides) { |
| 239 String script = artifact.filename; |
| 240 String type = artifact.mimeType; |
| 241 if (script != null && type != 'application/dart-snapshot') { |
| 242 throw "dart_product cannot run files of type '$type'."; |
| 243 } |
| 244 |
| 245 var augmentedArgs = new List(); |
| 246 augmentedArgs.add("--run-full-snapshot=${artifact.filename}"); |
| 247 augmentedArgs.addAll(arguments); |
| 248 |
| 249 return <Command>[commandBuilder.getVmCommand( |
| 250 suite.dartVmBinaryFileName, augmentedArgs, environmentOverrides)]; |
| 251 } |
| 252 } |
| 229 | 253 |
| 230 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration { | 254 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 231 List<Command> computeRuntimeCommands( | 255 List<Command> computeRuntimeCommands( |
| 232 TestSuite suite, | 256 TestSuite suite, |
| 233 CommandBuilder commandBuilder, | 257 CommandBuilder commandBuilder, |
| 234 CommandArtifact artifact, | 258 CommandArtifact artifact, |
| 235 List<String> arguments, | 259 List<String> arguments, |
| 236 Map<String, String> environmentOverrides) { | 260 Map<String, String> environmentOverrides) { |
| 237 String script = artifact.filename; | 261 String script = artifact.filename; |
| 238 String type = artifact.mimeType; | 262 String type = artifact.mimeType; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 258 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { | 282 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 259 List<Command> computeRuntimeCommands( | 283 List<Command> computeRuntimeCommands( |
| 260 TestSuite suite, | 284 TestSuite suite, |
| 261 CommandBuilder commandBuilder, | 285 CommandBuilder commandBuilder, |
| 262 CommandArtifact artifact, | 286 CommandArtifact artifact, |
| 263 List<String> arguments, | 287 List<String> arguments, |
| 264 Map<String, String> environmentOverrides) { | 288 Map<String, String> environmentOverrides) { |
| 265 throw "Unimplemented runtime '$runtimeType'"; | 289 throw "Unimplemented runtime '$runtimeType'"; |
| 266 } | 290 } |
| 267 } | 291 } |
| OLD | NEW |