| OLD | NEW |
| 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:async/async.dart'; | 8 import 'package:async/async.dart'; |
| 9 | 9 |
| 10 import 'backend/group.dart'; | 10 import 'backend/group.dart'; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 return loadSuite.changeSuite((suite) { | 195 return loadSuite.changeSuite((suite) { |
| 196 _warnForUnknownTags(suite); | 196 _warnForUnknownTags(suite); |
| 197 | 197 |
| 198 return suite.filter((test) { | 198 return suite.filter((test) { |
| 199 // Skip any tests that don't match the given pattern. | 199 // Skip any tests that don't match the given pattern. |
| 200 if (_config.pattern != null && !test.name.contains(_config.pattern)) { | 200 if (_config.pattern != null && !test.name.contains(_config.pattern)) { |
| 201 return false; | 201 return false; |
| 202 } | 202 } |
| 203 | 203 |
| 204 // If the user provided tags, skip tests that don't match all of them. | 204 // If the user provided tags, skip tests that don't match all of them. |
| 205 if (!_config.includeTags.isEmpty && | 205 if (!_config.includeTags.evaluate(test.metadata.tags)) return false; |
| 206 !test.metadata.tags.containsAll(_config.includeTags)) { | |
| 207 return false; | |
| 208 } | |
| 209 | 206 |
| 210 // Skip tests that do match any tags the user wants to exclude. | 207 // Skip tests that do match any tags the user wants to exclude. |
| 211 if (_config.excludeTags.intersection(test.metadata.tags).isNotEmpty) { | 208 if (_config.excludeTags.evaluate(test.metadata.tags)) return false; |
| 212 return false; | |
| 213 } | |
| 214 | 209 |
| 215 return true; | 210 return true; |
| 216 }); | 211 }); |
| 217 }); | 212 }); |
| 218 }); | 213 }); |
| 219 } | 214 } |
| 220 | 215 |
| 221 /// Prints a warning for any unknown tags referenced in [suite] or its | 216 /// Prints a warning for any unknown tags referenced in [suite] or its |
| 222 /// children. | 217 /// children. |
| 223 void _warnForUnknownTags(Suite suite) { | 218 void _warnForUnknownTags(Suite suite) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 await _debugOperation.valueOrCancellation(); | 301 await _debugOperation.valueOrCancellation(); |
| 307 }).listen(null); | 302 }).listen(null); |
| 308 | 303 |
| 309 var results = await Future.wait([ | 304 var results = await Future.wait([ |
| 310 _suiteSubscription.asFuture().then((_) => _engine.suiteSink.close()), | 305 _suiteSubscription.asFuture().then((_) => _engine.suiteSink.close()), |
| 311 _engine.run() | 306 _engine.run() |
| 312 ]); | 307 ]); |
| 313 return results.last; | 308 return results.last; |
| 314 } | 309 } |
| 315 } | 310 } |
| OLD | NEW |