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 List<String> defaultTestSelectors = | 7 List<String> defaultTestSelectors = |
8 const ['dartc', 'samples', 'standalone', 'corelib', 'co19', 'language', | 8 const ['dartc', 'samples', 'standalone', 'corelib', 'co19', 'language', |
9 'isolate', 'stub-generator', 'vm', 'client']; | 9 'isolate', 'stub-generator', 'vm', 'client', 'dartdoc']; |
10 | 10 |
11 /** | 11 /** |
12 * Specification of a single test option. | 12 * Specification of a single test option. |
13 * | 13 * |
14 * The name of the specification is used as the key for the option in | 14 * The name of the specification is used as the key for the option in |
15 * the Map returned from the [TestOptionParser] parse method. | 15 * the Map returned from the [TestOptionParser] parse method. |
16 */ | 16 */ |
17 class _TestOptionSpecification { | 17 class _TestOptionSpecification { |
18 _TestOptionSpecification(this.name, | 18 _TestOptionSpecification(this.name, |
19 this.description, | 19 this.description, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 for (var v in value.split(',')) { | 256 for (var v in value.split(',')) { |
257 if (spec.values.lastIndexOf(v) == -1) { | 257 if (spec.values.lastIndexOf(v) == -1) { |
258 print('Unknown value ($v) for option $name'); | 258 print('Unknown value ($v) for option $name'); |
259 exit(1); | 259 exit(1); |
260 } | 260 } |
261 } | 261 } |
262 } | 262 } |
263 configuration[spec.name] = value; | 263 configuration[spec.name] = value; |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 return _expandConfigurations(configuration); | 267 return _expandConfigurations(configuration); |
268 } | 268 } |
269 | 269 |
270 | 270 |
271 /** | 271 /** |
272 * Recursively expand a configuration with multiple values per key | 272 * Recursively expand a configuration with multiple values per key |
273 * into a list of configurations with exactly one value per key. | 273 * into a list of configurations with exactly one value per key. |
274 */ | 274 */ |
275 List<Map> _expandConfigurations(Map configuration) { | 275 List<Map> _expandConfigurations(Map configuration) { |
276 | 276 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 if (option.keys.some((key) => key == name)) { | 448 if (option.keys.some((key) => key == name)) { |
449 return option; | 449 return option; |
450 } | 450 } |
451 } | 451 } |
452 return null; | 452 return null; |
453 } | 453 } |
454 | 454 |
455 | 455 |
456 List<_TestOptionSpecification> _options; | 456 List<_TestOptionSpecification> _options; |
457 } | 457 } |
OLD | NEW |