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

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

Issue 1797113002: Add include_tags and exclude_tags config fields. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 9 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
« no previous file with comments | « doc/package_config.md ('k') | test/runner/configuration/tags_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/configuration/load.dart
diff --git a/lib/src/runner/configuration/load.dart b/lib/src/runner/configuration/load.dart
index 7dd2bb4ad669455b7220e38168b43697e92f09b1..e5b37afaa77b6ded44a560f80cd11d164aa4b023 100644
--- a/lib/src/runner/configuration/load.dart
+++ b/lib/src/runner/configuration/load.dart
@@ -177,6 +177,9 @@ class _ConfigurationLoader {
var chosenPresets = _getList("add_presets",
(presetNode) => _parseIdentifierLike(presetNode, "Preset name"));
+ var includeTags = _parseBooleanSelector("include_tags");
+ var excludeTags = _parseBooleanSelector("exclude_tags");
+
return new Configuration(
reporter: reporter,
pubServePort: pubServePort,
@@ -185,7 +188,9 @@ class _ConfigurationLoader {
platforms: platforms,
paths: paths,
filename: filename,
- chosenPresets: chosenPresets);
+ chosenPresets: chosenPresets,
+ includeTags: includeTags,
+ excludeTags: excludeTags);
}
/// Throws an exception with [message] if [test] returns `false` when passed
@@ -266,6 +271,8 @@ class _ConfigurationLoader {
value: (_, valueNode) => value(valueNode));
}
+ /// Verifies that [node]'s value is an optionally hyphenated Dart identifier,
+ /// and returns it
String _parseIdentifierLike(YamlNode node, String name) {
_validate(node, "$name must be a string.", (value) => value is String);
_validate(
@@ -275,6 +282,10 @@ class _ConfigurationLoader {
return node.value;
}
+ /// Parses [node]'s value as a boolean selector.
+ BooleanSelector _parseBooleanSelector(String name) =>
+ _parseValue(name, (value) => new BooleanSelector.parse(value));
+
/// Asserts that [node] is a string, passes its value to [parse], and returns
/// the result.
///
« no previous file with comments | « doc/package_config.md ('k') | test/runner/configuration/tags_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698