| 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_options_parser"); | 5 #library("test_options_parser"); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Specification of a single test option. | 8 * Specification of a single test option. |
| 9 * | 9 * |
| 10 * The name of the specification is used as the key for the option in | 10 * The name of the specification is used as the key for the option in |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if ((i + 1) >= arguments.length) { | 134 if ((i + 1) >= arguments.length) { |
| 135 print('No value supplied for option $name'); | 135 print('No value supplied for option $name'); |
| 136 return null; | 136 return null; |
| 137 } | 137 } |
| 138 value = arguments[++i]; | 138 value = arguments[++i]; |
| 139 } else { | 139 } else { |
| 140 // The option name does not start with '-' or '--' so we | 140 // The option name does not start with '-' or '--' so we |
| 141 // assume that the rest of the arguments specify tests or test | 141 // assume that the rest of the arguments specify tests or test |
| 142 // suites to run. | 142 // suites to run. |
| 143 configuration['rest'] = arguments.getRange(i, numArguments - i); | 143 configuration['rest'] = arguments.getRange(i, numArguments - i); |
| 144 return configuration; | 144 return _expandConfigurations(configuration); |
| 145 } | 145 } |
| 146 // Find the option specification for the name. | 146 // Find the option specification for the name. |
| 147 var spec = _getSpecification(name); | 147 var spec = _getSpecification(name); |
| 148 if (spec == null) { | 148 if (spec == null) { |
| 149 print('Unknown test option $name'); | 149 print('Unknown test option $name'); |
| 150 return null; | 150 return null; |
| 151 } | 151 } |
| 152 // Parse the value for the option. | 152 // Parse the value for the option. |
| 153 if (spec.type == 'bool') { | 153 if (spec.type == 'bool') { |
| 154 if (!value.isEmpty()) { | 154 if (!value.isEmpty()) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 if (option.keys.some((key) => key == name)) { | 300 if (option.keys.some((key) => key == name)) { |
| 301 return option; | 301 return option; |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 return null; | 304 return null; |
| 305 } | 305 } |
| 306 | 306 |
| 307 | 307 |
| 308 List<_TestOptionSpecification> _options; | 308 List<_TestOptionSpecification> _options; |
| 309 } | 309 } |
| OLD | NEW |