Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: lib/src/runner.dart

Issue 1802133002: Add names and plain_names 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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « doc/package_config.md ('k') | lib/src/runner/configuration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner.dart
diff --git a/lib/src/runner.dart b/lib/src/runner.dart
index 1eb6f2c78dc3ed248215f0738d75778a341f87d1..9f81f800dbae499eea4b11a37f9ffad5fe1faf8b 100644
--- a/lib/src/runner.dart
+++ b/lib/src/runner.dart
@@ -126,16 +126,13 @@ class Runner {
if (_closed) return false;
if (_engine.passed.length == 0 && _engine.failed.length == 0 &&
- _engine.skipped.length == 0 && _config.pattern != null) {
- var message = 'No tests match ';
+ _engine.skipped.length == 0 && _config.patterns.isNotEmpty) {
+ var patterns = toSentence(_config.patterns.map(
+ (pattern) => pattern is RegExp
+ ? 'regular expression "${pattern.pattern}"'
+ : '"$pattern"'))
- if (_config.pattern is RegExp) {
- var pattern = (_config.pattern as RegExp).pattern;
- message += 'regular expression "$pattern".';
- } else {
- message += '"${_config.pattern}".';
- }
- throw new ApplicationException(message);
+ throw new ApplicationException('No tests match $patterns.');
}
// Explicitly check "== true" here because [Engine.run] can return `null`
@@ -232,7 +229,7 @@ class Runner {
/// Return a stream of [LoadSuite]s in [_config.paths].
///
- /// Only tests that match [_config.pattern] will be included in the
+ /// Only tests that match [_config.patterns] will be included in the
/// suites once they're loaded.
Stream<LoadSuite> _loadSuites() {
return mergeStreams(_config.paths.map((path) {
@@ -248,8 +245,8 @@ class Runner {
_warnForUnknownTags(suite);
return suite.filter((test) {
- // Skip any tests that don't match the given pattern.
- if (_config.pattern != null && !test.name.contains(_config.pattern)) {
+ // Skip any tests that don't match all the given patterns.
+ if (!_config.patterns.every(test.name.contains)) {
return false;
}
« no previous file with comments | « doc/package_config.md ('k') | lib/src/runner/configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698