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

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

Issue 1730173004: Add on_os and on_platform fields. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 10 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 | « lib/src/backend/operating_system.dart ('k') | lib/src/runner/configuration/load.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/configuration.dart
diff --git a/lib/src/runner/configuration.dart b/lib/src/runner/configuration.dart
index 8b673e44c92d7d50ce7b10dd8b0157d0e77d60a4..aaeb94fbba041502ab40d8b18736d2f41fe20a1e 100644
--- a/lib/src/runner/configuration.dart
+++ b/lib/src/runner/configuration.dart
@@ -139,7 +139,8 @@ class Configuration {
skipReason: skipReason,
testOn: testOn,
tags: addTags,
- forTag: mapMap(tags, value: (_, config) => config.metadata));
+ forTag: mapMap(tags, value: (_, config) => config.metadata),
+ onPlatform: mapMap(onPlatform, value: (_, config) => config.metadata));
/// The set of tags that have been declaredin any way in this configuration.
Set<String> get knownTags {
@@ -158,6 +159,13 @@ class Configuration {
}
Set<String> _knownTags;
+ /// Configuration for particular platforms.
+ ///
+ /// The keys are platform selectors, and the values are configurations for
+ /// those platforms. These configuration should only contain test-level
+ /// configuration fields, but that isn't enforced.
+ final Map<PlatformSelector, Configuration> onPlatform;
+
/// Parses the configuration from [args].
///
/// Throws a [FormatException] if [args] are invalid.
@@ -191,7 +199,8 @@ class Configuration {
BooleanSelector includeTags,
BooleanSelector excludeTags,
Iterable addTags,
- Map<BooleanSelector, Configuration> tags})
+ Map<BooleanSelector, Configuration> tags,
+ Map<PlatformSelector, Configuration> onPlatform})
: _help = help,
_version = version,
_verboseTrace = verboseTrace,
@@ -215,7 +224,10 @@ class Configuration {
includeTags = includeTags ?? BooleanSelector.all,
excludeTags = excludeTags ?? BooleanSelector.none,
addTags = addTags?.toSet() ?? new Set(),
- tags = tags == null ? const {} : new Map.unmodifiable(tags) {
+ tags = tags == null ? const {} : new Map.unmodifiable(tags),
+ onPlatform = onPlatform == null
+ ? const {}
+ : new Map.unmodifiable(onPlatform) {
if (_filename != null && _filename.context.style != p.style) {
throw new ArgumentError(
"filename's context must match the current operating system, was "
@@ -263,6 +275,8 @@ class Configuration {
excludeTags: excludeTags.union(other.excludeTags),
addTags: other.addTags.union(addTags),
tags: mergeMaps(tags, other.tags,
+ value: (config1, config2) => config1.merge(config2)),
+ onPlatform: mergeMaps(onPlatform, other.onPlatform,
value: (config1, config2) => config1.merge(config2)));
}
}
« no previous file with comments | « lib/src/backend/operating_system.dart ('k') | lib/src/runner/configuration/load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698