OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'package:args/args.dart'; | 7 import 'package:args/args.dart'; |
8 import 'package:boolean_selector/boolean_selector.dart'; | 8 import 'package:boolean_selector/boolean_selector.dart'; |
9 | 9 |
10 import '../../backend/test_platform.dart'; | 10 import '../../backend/test_platform.dart'; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 help: 'Run only tests with all of the specified tags.\n' | 49 help: 'Run only tests with all of the specified tags.\n' |
50 'Supports boolean selector syntax.', | 50 'Supports boolean selector syntax.', |
51 allowMultiple: true); | 51 allowMultiple: true); |
52 parser.addOption("tag", hide: true, allowMultiple: true); | 52 parser.addOption("tag", hide: true, allowMultiple: true); |
53 parser.addOption("exclude-tags", | 53 parser.addOption("exclude-tags", |
54 abbr: 'x', | 54 abbr: 'x', |
55 help: "Don't run tests with any of the specified tags.\n" | 55 help: "Don't run tests with any of the specified tags.\n" |
56 "Supports boolean selector syntax.", | 56 "Supports boolean selector syntax.", |
57 allowMultiple: true); | 57 allowMultiple: true); |
58 parser.addOption("exclude-tag", hide: true, allowMultiple: true); | 58 parser.addOption("exclude-tag", hide: true, allowMultiple: true); |
| 59 parser.addFlag("run-skipped", |
| 60 help: 'Run skipped tests instead of skipping them.'); |
59 | 61 |
60 parser.addSeparator("======== Running Tests"); | 62 parser.addSeparator("======== Running Tests"); |
61 parser.addOption("platform", | 63 parser.addOption("platform", |
62 abbr: 'p', | 64 abbr: 'p', |
63 help: 'The platform(s) on which to run the tests.', | 65 help: 'The platform(s) on which to run the tests.', |
64 defaultsTo: 'vm', | 66 defaultsTo: 'vm', |
65 allowed: allPlatforms.map((platform) => platform.identifier).toList(), | 67 allowed: allPlatforms.map((platform) => platform.identifier).toList(), |
66 allowMultiple: true); | 68 allowMultiple: true); |
67 parser.addOption("preset", | 69 parser.addOption("preset", |
68 abbr: 'P', | 70 abbr: 'P', |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 precompiledPath: _ifParsed('precompiled'), | 198 precompiledPath: _ifParsed('precompiled'), |
197 reporter: _ifParsed('reporter'), | 199 reporter: _ifParsed('reporter'), |
198 pubServePort: _parseOption('pub-serve', int.parse), | 200 pubServePort: _parseOption('pub-serve', int.parse), |
199 concurrency: _parseOption('concurrency', int.parse), | 201 concurrency: _parseOption('concurrency', int.parse), |
200 shardIndex: shardIndex, | 202 shardIndex: shardIndex, |
201 totalShards: totalShards, | 203 totalShards: totalShards, |
202 timeout: _parseOption('timeout', (value) => new Timeout.parse(value)), | 204 timeout: _parseOption('timeout', (value) => new Timeout.parse(value)), |
203 patterns: patterns, | 205 patterns: patterns, |
204 platforms: (_ifParsed('platform') as List<String>) | 206 platforms: (_ifParsed('platform') as List<String>) |
205 ?.map(TestPlatform.find), | 207 ?.map(TestPlatform.find), |
| 208 runSkipped: _ifParsed('run-skipped'), |
206 chosenPresets: _ifParsed('preset') as List<String>, | 209 chosenPresets: _ifParsed('preset') as List<String>, |
207 paths: _options.rest.isEmpty ? null : _options.rest, | 210 paths: _options.rest.isEmpty ? null : _options.rest, |
208 includeTags: includeTags, | 211 includeTags: includeTags, |
209 excludeTags: excludeTags); | 212 excludeTags: excludeTags); |
210 } | 213 } |
211 | 214 |
212 /// Returns the parsed option for [name], or `null` if none was parsed. | 215 /// Returns the parsed option for [name], or `null` if none was parsed. |
213 /// | 216 /// |
214 /// If the user hasn't explicitly chosen a value, we want to pass null values | 217 /// If the user hasn't explicitly chosen a value, we want to pass null values |
215 /// to [new Configuration] so that it considers those fields unset when | 218 /// to [new Configuration] so that it considers those fields unset when |
(...skipping 15 matching lines...) Expand all Loading... |
231 /// information. | 234 /// information. |
232 /*=T*/ _wrapFormatException/*<T>*/(String name, /*=T*/ parse()) { | 235 /*=T*/ _wrapFormatException/*<T>*/(String name, /*=T*/ parse()) { |
233 try { | 236 try { |
234 return parse(); | 237 return parse(); |
235 } on FormatException catch (error) { | 238 } on FormatException catch (error) { |
236 throw new FormatException('Couldn\'t parse --$name "${_options[name]}": ' | 239 throw new FormatException('Couldn\'t parse --$name "${_options[name]}": ' |
237 '${error.message}'); | 240 '${error.message}'); |
238 } | 241 } |
239 } | 242 } |
240 } | 243 } |
OLD | NEW |