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 library test.runner; | 5 library test.runner; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:async/async.dart'; | 10 import 'package:async/async.dart'; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 return mergeStreams(_config.paths.map((path) { | 151 return mergeStreams(_config.paths.map((path) { |
152 if (new Directory(path).existsSync()) return _loader.loadDir(path); | 152 if (new Directory(path).existsSync()) return _loader.loadDir(path); |
153 if (new File(path).existsSync()) return _loader.loadFile(path); | 153 if (new File(path).existsSync()) return _loader.loadFile(path); |
154 | 154 |
155 return new Stream.fromIterable([ | 155 return new Stream.fromIterable([ |
156 new LoadSuite("loading $path", () => | 156 new LoadSuite("loading $path", () => |
157 throw new LoadException(path, 'Does not exist.')) | 157 throw new LoadException(path, 'Does not exist.')) |
158 ]); | 158 ]); |
159 })).map((loadSuite) { | 159 })).map((loadSuite) { |
160 return loadSuite.changeSuite((suite) { | 160 return loadSuite.changeSuite((suite) { |
161 if (_config.pattern == null) return suite; | 161 return suite.filter((test) => |
162 return suite.filter((test) => test.name.contains(_config.pattern)); | 162 (_config.pattern == null || test.name.contains(_config.pattern)) && |
| 163 (_config.tags.isEmpty || intersect(_config.tags, test.metadata.tags)
)); |
163 }); | 164 }); |
164 }); | 165 }); |
165 } | 166 } |
166 | 167 |
167 /// Loads each suite in [suites] in order, pausing after load for platforms | 168 /// Loads each suite in [suites] in order, pausing after load for platforms |
168 /// that support debugging. | 169 /// that support debugging. |
169 Future<bool> _loadThenPause(Stream<LoadSuite> suites) async { | 170 Future<bool> _loadThenPause(Stream<LoadSuite> suites) async { |
170 if (_config.platforms.contains(TestPlatform.vm)) { | 171 if (_config.platforms.contains(TestPlatform.vm)) { |
171 warn("Debugging is currently unsupported on the Dart VM.", | 172 warn("Debugging is currently unsupported on the Dart VM.", |
172 color: _config.color); | 173 color: _config.color); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 247 |
247 await inCompletionOrder([ | 248 await inCompletionOrder([ |
248 suite.environment.displayPause(), | 249 suite.environment.displayPause(), |
249 cancelableNext(stdinLines) | 250 cancelableNext(stdinLines) |
250 ]).first; | 251 ]).first; |
251 } finally { | 252 } finally { |
252 _reporter.resume(); | 253 _reporter.resume(); |
253 } | 254 } |
254 } | 255 } |
255 } | 256 } |
OLD | NEW |