Index: lib/src/runner/configuration.dart |
diff --git a/lib/src/runner/configuration.dart b/lib/src/runner/configuration.dart |
index bb28aeb87c926a81351280e218c615abd5278ca4..d0f406b7e70b41907a8634d66b23b74983507932 100644 |
--- a/lib/src/runner/configuration.dart |
+++ b/lib/src/runner/configuration.dart |
@@ -78,9 +78,15 @@ class Configuration { |
parser.addFlag("color", defaultsTo: null, |
help: 'Whether to use terminal colors.\n(auto-detected by default)'); |
parser.addOption("tags", |
+ abbr: 't', |
help: 'Comma-separated list of tags to run', |
allowMultiple: true, |
splitCommas: true); |
+ parser.addOption("tag", |
+ hide: true, |
+ help: 'Same as --tags', |
+ allowMultiple: true, |
+ splitCommas: true); |
return parser; |
})(); |
@@ -135,7 +141,7 @@ class Configuration { |
final List<TestPlatform> platforms; |
/// Restricts the set of tests to a set of tags |
- final List<String> tags; |
+ final Set<String> tags; |
/// The global test metadata derived from this configuration. |
Metadata get metadata => |
@@ -162,6 +168,13 @@ class Configuration { |
pattern = options['plain-name']; |
} |
+ var tags = new Set<String>(); |
+ if (options['tags'] != null) { |
+ tags.addAll(options['tags']); |
+ } |
+ if (options['tag'] != null) { |
+ tags.addAll(options['tag']); |
+ } |
return new Configuration( |
help: options['help'], |
version: options['version'], |
@@ -177,7 +190,7 @@ class Configuration { |
pattern: pattern, |
platforms: options['platform'].map(TestPlatform.find), |
paths: options.rest.isEmpty ? null : options.rest, |
- tags: options['tags']); |
+ tags: tags); |
} |
/// Runs [parse] on the value of the option [name], and wraps any |
@@ -200,7 +213,7 @@ class Configuration { |
bool pauseAfterLoad: false, bool color, String packageRoot, |
String reporter, int pubServePort, int concurrency, this.pattern, |
Iterable<TestPlatform> platforms, Iterable<String> paths, |
- List<String> tags}) |
+ Set<String> tags}) |
: pauseAfterLoad = pauseAfterLoad, |
color = color == null ? canUseSpecialChars : color, |
packageRoot = packageRoot == null |
@@ -216,7 +229,5 @@ class Configuration { |
platforms = platforms == null ? [TestPlatform.vm] : platforms.toList(), |
paths = paths == null ? ["test"] : paths.toList(), |
explicitPaths = paths != null, |
- this.tags = tags == null |
- ? const <String>[] |
- : tags; |
+ this.tags = tags; |
} |