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 compiler_configuration; | 5 library compiler_configuration; |
| 6 | 6 |
| 7 import 'dart:io' show Platform; | 7 import 'dart:io' show Platform; |
| 8 | 8 |
| 9 import 'runtime_configuration.dart' show RuntimeConfiguration; | 9 import 'runtime_configuration.dart' show RuntimeConfiguration; |
| 10 | 10 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; |
| 11 import 'test_runner.dart' show Command, CommandBuilder, CompilationCommand; | 11 import 'test_runner.dart' show Command, CommandBuilder, CompilationCommand; |
| 12 | |
| 13 import 'test_suite.dart' show TestInformation, TestUtils; | 12 import 'test_suite.dart' show TestInformation, TestUtils; |
| 14 | 13 |
| 15 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; | 14 List<String> replaceDartFileWith(List<String> list, String replacement) { |
| 15 var copy = new List<String>.from(list); | |
| 16 for (var i = 0; i < copy.length; i++) { | |
| 17 if (copy[i].endsWith(".dart")) { | |
| 18 copy[i] = replacement; | |
| 19 } | |
| 20 } | |
| 21 return copy; | |
| 22 } | |
| 16 | 23 |
| 17 /// Grouping of a command with its expected result. | 24 /// Grouping of a command with its expected result. |
| 18 class CommandArtifact { | 25 class CommandArtifact { |
| 19 final List<Command> commands; | 26 final List<Command> commands; |
| 20 | 27 |
| 21 /// Expected result of running [command]. | 28 /// Expected result of running [command]. |
| 22 final String filename; | 29 final String filename; |
| 23 | 30 |
| 24 /// MIME type of [filename]. | 31 /// MIME type of [filename]. |
| 25 final String mimeType; | 32 final String mimeType; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 List<String> vmOptions, | 284 List<String> vmOptions, |
| 278 List<String> sharedOptions, | 285 List<String> sharedOptions, |
| 279 List<String> originalArguments, | 286 List<String> originalArguments, |
| 280 CommandArtifact artifact) { | 287 CommandArtifact artifact) { |
| 281 List<String> args = []; | 288 List<String> args = []; |
| 282 if (isChecked) { | 289 if (isChecked) { |
| 283 args.add('--enable_asserts'); | 290 args.add('--enable_asserts'); |
| 284 args.add('--enable_type_checks'); | 291 args.add('--enable_type_checks'); |
| 285 } | 292 } |
| 286 | 293 |
| 287 var newOriginalArguments = new List<String>.from(originalArguments); | 294 var newOriginalArguments = replaceDartFileWith( |
| 288 for (var i = 0; i < newOriginalArguments .length; i++) { | 295 originalArguments, artifact.filename); |
| 289 if (newOriginalArguments[i].endsWith(".dart")) { | |
| 290 newOriginalArguments[i] = artifact.filename; | |
| 291 } | |
| 292 } | |
| 293 | 296 |
| 294 return args | 297 return args |
| 295 ..addAll(vmOptions) | 298 ..addAll(vmOptions) |
| 296 ..addAll(sharedOptions) | 299 ..addAll(sharedOptions) |
| 297 ..addAll(newOriginalArguments); | 300 ..addAll(newOriginalArguments); |
| 298 } | 301 } |
| 299 } | 302 } |
| 300 | 303 |
| 301 typedef List<String> CompilerArgumentsFunction( | 304 typedef List<String> CompilerArgumentsFunction( |
| 302 List<String> globalArguments, | 305 List<String> globalArguments, |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 326 assert(filtered.length == 1); | 329 assert(filtered.length == 1); |
| 327 return filtered; | 330 return filtered; |
| 328 }); | 331 }); |
| 329 } | 332 } |
| 330 | 333 |
| 331 factory PipelineCommand.runWithPreviousKernelOutput( | 334 factory PipelineCommand.runWithPreviousKernelOutput( |
| 332 CompilerConfiguration conf) { | 335 CompilerConfiguration conf) { |
| 333 return new PipelineCommand._(conf, (List<String> globalArguments, | 336 return new PipelineCommand._(conf, (List<String> globalArguments, |
| 334 String previousOutput) { | 337 String previousOutput) { |
| 335 assert(previousOutput.endsWith('.dill')); | 338 assert(previousOutput.endsWith('.dill')); |
| 336 return []..addAll(globalArguments)..add(previousOutput); | 339 return replaceDartFileWith(globalArguments, previousOutput); |
|
kustermann
2017/01/18 21:41:01
This line was the issue.
| |
| 337 }); | 340 }); |
| 338 } | 341 } |
| 339 | 342 |
| 340 List<String> extractArguments(List<String> globalArguments, | 343 List<String> extractArguments(List<String> globalArguments, |
| 341 String previousOutput) { | 344 String previousOutput) { |
| 342 return _argumentsFunction(globalArguments, previousOutput); | 345 return _argumentsFunction(globalArguments, previousOutput); |
| 343 } | 346 } |
| 344 } | 347 } |
| 345 | 348 |
| 346 class ComposedCompilerConfiguration extends CompilerConfiguration { | 349 class ComposedCompilerConfiguration extends CompilerConfiguration { |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 TestInformation info, | 730 TestInformation info, |
| 728 List<String> vmOptions, | 731 List<String> vmOptions, |
| 729 List<String> sharedOptions, | 732 List<String> sharedOptions, |
| 730 List<String> originalArguments, | 733 List<String> originalArguments, |
| 731 CommandArtifact artifact) { | 734 CommandArtifact artifact) { |
| 732 List<String> args = []; | 735 List<String> args = []; |
| 733 if (isChecked) { | 736 if (isChecked) { |
| 734 args.add('--enable_asserts'); | 737 args.add('--enable_asserts'); |
| 735 args.add('--enable_type_checks'); | 738 args.add('--enable_type_checks'); |
| 736 } | 739 } |
| 737 var newOriginalArguments = new List<String>.from(originalArguments); | 740 |
| 738 for (var i = 0; i < newOriginalArguments .length; i++) { | 741 var dir = artifact.filename; |
| 739 if (newOriginalArguments[i].endsWith(".dart")) { | 742 if (runtimeConfiguration is DartPrecompiledAdbRuntimeConfiguration) { |
| 740 var dir = artifact.filename; | 743 // On android the precompiled snapshot will be pushed to a different |
| 741 if (runtimeConfiguration is DartPrecompiledAdbRuntimeConfiguration) { | 744 // directory on the device, use that one instead. |
| 742 // On android the precompiled snapshot will be pushed to a different | 745 dir = DartPrecompiledAdbRuntimeConfiguration.DeviceTestDir; |
| 743 // directory on the device, use that one instead. | |
| 744 dir = DartPrecompiledAdbRuntimeConfiguration.DeviceTestDir; | |
| 745 } | |
| 746 newOriginalArguments[i] = "$dir/out.aotsnapshot"; | |
| 747 } | |
| 748 } | 746 } |
| 747 originalArguments = replaceDartFileWith( | |
| 748 originalArguments, "$dir/out.aotsnapshot"); | |
| 749 | |
| 749 return args | 750 return args |
| 750 ..addAll(vmOptions) | 751 ..addAll(vmOptions) |
| 751 ..addAll(sharedOptions) | 752 ..addAll(sharedOptions) |
| 752 ..addAll(newOriginalArguments); | 753 ..addAll(originalArguments); |
| 753 } | 754 } |
| 754 } | 755 } |
| 755 | 756 |
| 756 class Dart2AppSnapshotCompilerConfiguration extends CompilerConfiguration { | 757 class Dart2AppSnapshotCompilerConfiguration extends CompilerConfiguration { |
| 757 Dart2AppSnapshotCompilerConfiguration({bool isDebug, bool isChecked}) | 758 Dart2AppSnapshotCompilerConfiguration({bool isDebug, bool isChecked}) |
| 758 : super._subclass(isDebug: isDebug, isChecked: isChecked); | 759 : super._subclass(isDebug: isDebug, isChecked: isChecked); |
| 759 | 760 |
| 760 int computeTimeoutMultiplier() { | 761 int computeTimeoutMultiplier() { |
| 761 int multiplier = 2; | 762 int multiplier = 2; |
| 762 if (isDebug) multiplier *= 4; | 763 if (isDebug) multiplier *= 4; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 897 RuntimeConfiguration runtimeConfiguration, | 898 RuntimeConfiguration runtimeConfiguration, |
| 898 String buildDir, | 899 String buildDir, |
| 899 TestInformation info, | 900 TestInformation info, |
| 900 List<String> vmOptions, | 901 List<String> vmOptions, |
| 901 List<String> sharedOptions, | 902 List<String> sharedOptions, |
| 902 List<String> originalArguments, | 903 List<String> originalArguments, |
| 903 CommandArtifact artifact) { | 904 CommandArtifact artifact) { |
| 904 return <String>[]; | 905 return <String>[]; |
| 905 } | 906 } |
| 906 } | 907 } |
| OLD | NEW |