| 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 'dart:io' show Directory, File; | 7 import 'dart:io' show Directory, File; |
| 8 | 8 |
| 9 import 'compiler_configuration.dart' show CommandArtifact; | 9 import 'compiler_configuration.dart' show CommandArtifact; |
| 10 | 10 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 final bool needsDFERunner = suite.configuration['compiler'] == 'dartk' && | 230 final bool needsDFERunner = suite.configuration['compiler'] == 'dartk' && |
| 231 !suite.configuration['use-standalone-dartk']; | 231 !suite.configuration['use-standalone-dartk']; |
| 232 String script = artifact.filename; | 232 String script = artifact.filename; |
| 233 String type = artifact.mimeType; | 233 String type = artifact.mimeType; |
| 234 if (script != null && | 234 if (script != null && |
| 235 type != 'application/dart' && | 235 type != 'application/dart' && |
| 236 type != 'application/dart-snapshot') { | 236 type != 'application/dart-snapshot') { |
| 237 throw "Dart VM cannot run files of type '$type'."; | 237 throw "Dart VM cannot run files of type '$type'."; |
| 238 } | 238 } |
| 239 String executable = suite.dartVmBinaryFileName; | 239 String executable = suite.dartVmBinaryFileName; |
| 240 return <Command>[ | 240 var commands = new List<Command>(); |
| 241 commandBuilder.getVmCommand(executable, arguments, environmentOverrides, n
eedsDFERunner: needsDFERunner) | 241 commands.add(commandBuilder.getVmCommand(executable, |
| 242 ]; | 242 arguments, |
| 243 environmentOverrides, |
| 244 needsDFERunner: needsDFERunner)); |
| 245 if (type == 'application/dart-snapshot') { |
| 246 // Delete snapshots as we go to reduce the space required to run the test |
| 247 // suite. |
| 248 commands.add(commandBuilder.getDeleteCommand(script)); |
| 249 } |
| 250 return commands; |
| 243 } | 251 } |
| 244 } | 252 } |
| 245 | 253 |
| 246 /// The flutter engine binary, "sky_shell". | 254 /// The flutter engine binary, "sky_shell". |
| 247 class StandaloneFlutterEngineConfiguration extends DartVmRuntimeConfiguration { | 255 class StandaloneFlutterEngineConfiguration extends DartVmRuntimeConfiguration { |
| 248 List<Command> computeRuntimeCommands( | 256 List<Command> computeRuntimeCommands( |
| 249 TestSuite suite, | 257 TestSuite suite, |
| 250 CommandBuilder commandBuilder, | 258 CommandBuilder commandBuilder, |
| 251 CommandArtifact artifact, | 259 CommandArtifact artifact, |
| 252 List<String> arguments, | 260 List<String> arguments, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 275 CommandBuilder commandBuilder, | 283 CommandBuilder commandBuilder, |
| 276 CommandArtifact artifact, | 284 CommandArtifact artifact, |
| 277 List<String> arguments, | 285 List<String> arguments, |
| 278 Map<String, String> environmentOverrides) { | 286 Map<String, String> environmentOverrides) { |
| 279 String script = artifact.filename; | 287 String script = artifact.filename; |
| 280 String type = artifact.mimeType; | 288 String type = artifact.mimeType; |
| 281 if (script != null && type != 'application/dart-precompiled') { | 289 if (script != null && type != 'application/dart-precompiled') { |
| 282 throw "dart_precompiled cannot run files of type '$type'."; | 290 throw "dart_precompiled cannot run files of type '$type'."; |
| 283 } | 291 } |
| 284 | 292 |
| 285 return <Command>[ | 293 var commands = new List<Command>(); |
| 286 commandBuilder.getVmCommand(suite.dartPrecompiledBinaryFileName, | 294 commands.add(commandBuilder.getVmCommand(suite.dartPrecompiledBinaryFileName
, |
| 287 arguments, environmentOverrides) | 295 arguments, environmentOverrides)); |
| 288 ]; | 296 // Delete snapshots (dylibs or blobs) as we go to reduce the space required |
| 297 // to run the test suite. |
| 298 commands.add(commandBuilder.getDeleteCommand(script)); |
| 299 return commands; |
| 289 } | 300 } |
| 290 } | 301 } |
| 291 | 302 |
| 292 class DartPrecompiledAdbRuntimeConfiguration | 303 class DartPrecompiledAdbRuntimeConfiguration |
| 293 extends DartVmRuntimeConfiguration { | 304 extends DartVmRuntimeConfiguration { |
| 294 static const String DeviceDir = | 305 static const String DeviceDir = |
| 295 '/data/local/tmp/precompilation-testing'; | 306 '/data/local/tmp/precompilation-testing'; |
| 296 static const String DeviceTestDir = | 307 static const String DeviceTestDir = |
| 297 '/data/local/tmp/precompilation-testing/test'; | 308 '/data/local/tmp/precompilation-testing/test'; |
| 298 | 309 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { | 374 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 364 List<Command> computeRuntimeCommands( | 375 List<Command> computeRuntimeCommands( |
| 365 TestSuite suite, | 376 TestSuite suite, |
| 366 CommandBuilder commandBuilder, | 377 CommandBuilder commandBuilder, |
| 367 CommandArtifact artifact, | 378 CommandArtifact artifact, |
| 368 List<String> arguments, | 379 List<String> arguments, |
| 369 Map<String, String> environmentOverrides) { | 380 Map<String, String> environmentOverrides) { |
| 370 throw "Unimplemented runtime '$runtimeType'"; | 381 throw "Unimplemented runtime '$runtimeType'"; |
| 371 } | 382 } |
| 372 } | 383 } |
| OLD | NEW |