Chromium Code Reviews

Side by Side Diff: lib/src/backend/metadata.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, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « doc/package_config.md ('k') | lib/src/backend/operating_system.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:collection'; 5 import 'dart:collection';
6 6
7 import 'package:boolean_selector/boolean_selector.dart'; 7 import 'package:boolean_selector/boolean_selector.dart';
8 import 'package:collection/collection.dart'; 8 import 'package:collection/collection.dart';
9 9
10 import '../frontend/skip.dart'; 10 import '../frontend/skip.dart';
(...skipping 122 matching lines...)
133 skip: skip, 133 skip: skip,
134 verboseTrace: verboseTrace, 134 verboseTrace: verboseTrace,
135 skipReason: skipReason, 135 skipReason: skipReason,
136 tags: tags, 136 tags: tags,
137 onPlatform: onPlatform, 137 onPlatform: onPlatform,
138 forTag: forTag); 138 forTag: forTag);
139 139
140 // If there's no tag-specific metadata, or if none of it applies, just 140 // If there's no tag-specific metadata, or if none of it applies, just
141 // return the metadata as-is. 141 // return the metadata as-is.
142 if (forTag == null || tags == null) return _unresolved(); 142 if (forTag == null || tags == null) return _unresolved();
143 forTag = new Map.from(forTag);
143 144
144 // Otherwise, resolve the tag-specific components. Doing this eagerly means 145 // Otherwise, resolve the tag-specific components. Doing this eagerly means
145 // we only have to resolve suite- or group-level tags once, rather than 146 // we only have to resolve suite- or group-level tags once, rather than
146 // doing it for every test individually. 147 // doing it for every test individually.
147 var empty = new Metadata._(); 148 var empty = new Metadata._();
148 var merged = forTag.keys.toList().fold(empty, (merged, selector) { 149 var merged = forTag.keys.toList().fold(empty, (merged, selector) {
149 if (!selector.evaluate(tags)) return merged; 150 if (!selector.evaluate(tags)) return merged;
150 return merged.merge(forTag.remove(selector)); 151 return merged.merge(forTag.remove(selector));
151 }); 152 });
152 153
(...skipping 161 matching lines...)
314 _serializeTimeout(Timeout timeout) { 315 _serializeTimeout(Timeout timeout) {
315 if (timeout == Timeout.none) return 'none'; 316 if (timeout == Timeout.none) return 'none';
316 return { 317 return {
317 'duration': timeout.duration == null 318 'duration': timeout.duration == null
318 ? null 319 ? null
319 : timeout.duration.inMicroseconds, 320 : timeout.duration.inMicroseconds,
320 'scaleFactor': timeout.scaleFactor 321 'scaleFactor': timeout.scaleFactor
321 }; 322 };
322 } 323 }
323 } 324 }
OLDNEW
« no previous file with comments | « doc/package_config.md ('k') | lib/src/backend/operating_system.dart » ('j') | no next file with comments »

Powered by Google App Engine