Chromium Code Reviews| Index: lib/src/runner/configuration.dart |
| diff --git a/lib/src/runner/configuration.dart b/lib/src/runner/configuration.dart |
| index 8b673e44c92d7d50ce7b10dd8b0157d0e77d60a4..4cc540ee942bf812ca3d47347c89d9723567540e 100644 |
| --- a/lib/src/runner/configuration.dart |
| +++ b/lib/src/runner/configuration.dart |
| @@ -10,6 +10,7 @@ import 'package:glob/glob.dart'; |
| import 'package:path/path.dart' as p; |
| import '../backend/metadata.dart'; |
| +import '../backend/operating_system.dart'; |
|
kevmoo
2016/02/26 23:06:20
unused import?
nweiz
2016/03/01 02:24:04
Done.
|
| import '../backend/platform_selector.dart'; |
| import '../backend/test_platform.dart'; |
| import '../frontend/timeout.dart'; |
| @@ -139,7 +140,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 +160,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 +200,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 +225,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 +276,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))); |
| } |
| } |