| 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 #library("test_config_utils"); | 5 #library("test_config_utils"); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * TestUtils is a collection of utility methods used to write | 8 * TestUtils is a collection of utility methods used to write |
| 9 * test_config.dart scripts for test suites. | 9 * test_config.dart scripts for test suites. |
| 10 */ | 10 */ |
| 11 class TestUtils { | 11 class TestUtils { |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Get a list of argument lists for the dart shell command. | 14 * Get a list of argument lists for the dart shell command. |
| 15 */ | 15 */ |
| 16 static List<List<String>> argumentLists(String filename, | 16 static List<List<String>> argumentLists(String filename, |
| 17 Map optionsFromFile, | 17 Map optionsFromFile, |
| 18 Map configuration) { | 18 Map configuration) { |
| 19 List args = ["--ignore-unrecognized-flags"]; | 19 List args = ["--ignore-unrecognized-flags"]; |
| 20 if (configuration["checked"]) { | 20 if (configuration["checked"]) { |
| 21 args.add("--enable_type_checks"); | 21 args.add("--enable_type_checks"); |
| 22 } | 22 } |
| 23 if (configuration["component"] == "leg") { | 23 if (configuration["component"] == "leg") { |
| 24 args.add("--enable_leg"); | 24 args.add("--enable_leg"); |
| 25 } | 25 } |
| 26 if (configuration["component"] == "dartc") { |
| 27 if (configuration["mode"] == "release") { |
| 28 args.add("--optimize"); |
| 29 } |
| 30 } |
| 26 | 31 |
| 27 List<String> dartOptions = optionsFromFile["dartOptions"]; | 32 List<String> dartOptions = optionsFromFile["dartOptions"]; |
| 28 args.addAll(dartOptions == null ? [filename] : dartOptions); | 33 args.addAll(dartOptions == null ? [filename] : dartOptions); |
| 29 | 34 |
| 30 var result = new List<List<String>>(); | 35 var result = new List<List<String>>(); |
| 31 List<List<String>> vmOptionsList = optionsFromFile["vmOptions"]; | 36 List<List<String>> vmOptionsList = optionsFromFile["vmOptions"]; |
| 32 if (vmOptionsList.isEmpty()) { | 37 if (vmOptionsList.isEmpty()) { |
| 33 result.add(args); | 38 result.add(args); |
| 34 } else { | 39 } else { |
| 35 for (var vmOptions in vmOptionsList) { | 40 for (var vmOptions in vmOptionsList) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } else if (contents.contains("@dynamic-type-error") && | 92 } else if (contents.contains("@dynamic-type-error") && |
| 88 configuration['checked']) { | 93 configuration['checked']) { |
| 89 isNegative = true; | 94 isNegative = true; |
| 90 } | 95 } |
| 91 | 96 |
| 92 return { "vmOptions": result, | 97 return { "vmOptions": result, |
| 93 "dartOptions": dartOptions, | 98 "dartOptions": dartOptions, |
| 94 "isNegative" : isNegative }; | 99 "isNegative" : isNegative }; |
| 95 } | 100 } |
| 96 } | 101 } |
| OLD | NEW |