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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (_config.pattern == null) return suite; |
162 return suite.change(tests: suite.tests.where((test) => | 162 return suite.filter((test) => test.name.contains(_config.pattern)); |
163 test.name.contains(_config.pattern))); | |
164 }); | 163 }); |
165 }); | 164 }); |
166 } | 165 } |
167 | 166 |
168 /// Loads each suite in [suites] in order, pausing after load for platforms | 167 /// Loads each suite in [suites] in order, pausing after load for platforms |
169 /// that support debugging. | 168 /// that support debugging. |
170 Future<bool> _loadThenPause(Stream<LoadSuite> suites) async { | 169 Future<bool> _loadThenPause(Stream<LoadSuite> suites) async { |
171 if (_config.platforms.contains(TestPlatform.vm)) { | 170 if (_config.platforms.contains(TestPlatform.vm)) { |
172 warn("Debugging is currently unsupported on the Dart VM.", | 171 warn("Debugging is currently unsupported on the Dart VM.", |
173 color: _config.color); | 172 color: _config.color); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 246 |
248 await inCompletionOrder([ | 247 await inCompletionOrder([ |
249 suite.environment.displayPause(), | 248 suite.environment.displayPause(), |
250 cancelableNext(stdinLines) | 249 cancelableNext(stdinLines) |
251 ]).first; | 250 ]).first; |
252 } finally { | 251 } finally { |
253 _reporter.resume(); | 252 _reporter.resume(); |
254 } | 253 } |
255 } | 254 } |
256 } | 255 } |
OLD | NEW |