Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Unified Diff: lib/src/runner/configuration.dart

Issue 1405633004: feature: tag tests; choose tags on command line Base URL: git@github.com:yjbanov/test.git@tags
Patch Set: address review comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698