OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'configuration.dart'; | 7 import 'configuration.dart'; |
8 import 'drt_updater.dart'; | 8 import 'drt_updater.dart'; |
9 import 'path.dart'; | 9 import 'path.dart'; |
10 import 'test_suite.dart'; | 10 import 'test_suite.dart'; |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 'write_test_outcome_log', | 323 'write_test_outcome_log', |
324 ].toSet(); | 324 ].toSet(); |
325 | 325 |
326 /// Parses a list of strings as test options. | 326 /// Parses a list of strings as test options. |
327 /// | 327 /// |
328 /// Returns a list of configurations in which to run the tests. | 328 /// Returns a list of configurations in which to run the tests. |
329 /// Configurations are maps mapping from option keys to values. When | 329 /// Configurations are maps mapping from option keys to values. When |
330 /// encountering the first non-option string, the rest of the arguments are | 330 /// encountering the first non-option string, the rest of the arguments are |
331 /// stored in the returned Map under the 'rest' key. | 331 /// stored in the returned Map under the 'rest' key. |
332 List<Configuration> parse(List<String> arguments) { | 332 List<Configuration> parse(List<String> arguments) { |
333 // TODO(rnystrom): The builders on the buildbots still pass this even | |
334 // though it does nothing. Until those can be fixed, silently ignore the | |
335 // option. Remove this once the buildbot scripts are fixed. | |
336 if (arguments.contains("--failure-summary")) { | |
337 arguments = arguments.where((arg) => arg != "--failure-summary").toList(); | |
338 print('Note: Ignoring unsupported "--failure-summary" option.'); | |
339 } | |
340 | |
341 var configuration = <String, dynamic>{}; | 333 var configuration = <String, dynamic>{}; |
342 | 334 |
343 // Fill in configuration with arguments passed to the test script. | 335 // Fill in configuration with arguments passed to the test script. |
344 for (var i = 0; i < arguments.length; i++) { | 336 for (var i = 0; i < arguments.length; i++) { |
345 var arg = arguments[i]; | 337 var arg = arguments[i]; |
346 | 338 |
347 // Help supersedes all other arguments. | 339 // Help supersedes all other arguments. |
348 if (arg == "--help" || arg == "-h") { | 340 if (arg == "--help" || arg == "-h") { |
349 _printHelp(); | 341 _printHelp(); |
350 return null; | 342 return null; |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 if (name == option.name) return option; | 770 if (name == option.name) return option; |
779 | 771 |
780 // Allow hyphens instead of underscores as the separator since they are | 772 // Allow hyphens instead of underscores as the separator since they are |
781 // more common for command line flags. | 773 // more common for command line flags. |
782 if (name == option.name.replaceAll("_", "-")) return option; | 774 if (name == option.name.replaceAll("_", "-")) return option; |
783 } | 775 } |
784 | 776 |
785 return null; | 777 return null; |
786 } | 778 } |
787 } | 779 } |
OLD | NEW |