Chromium Code Reviews| Index: lib/src/runner/configuration.dart |
| diff --git a/lib/src/runner/configuration.dart b/lib/src/runner/configuration.dart |
| index 28f42788636b964fc87e35d648c96ab29b377b56..ff26d84e27071b699ad88b78725a1b6bb0406410 100644 |
| --- a/lib/src/runner/configuration.dart |
| +++ b/lib/src/runner/configuration.dart |
| @@ -4,6 +4,7 @@ |
| import 'dart:io'; |
| +import 'package:glob/glob.dart'; |
| import 'package:path/path.dart' as p; |
| import '../frontend/timeout.dart'; |
| @@ -75,6 +76,12 @@ class Configuration { |
| /// Whether the load paths were passed explicitly or the default was used. |
| bool get explicitPaths => _paths != null; |
| + /// The glob matching the basename of tests to run. |
| + /// |
| + /// This is used to find tests within a directory. |
| + Glob get filename => _filename ?? new Glob("*_test.dart"); |
| + final Glob _filename; |
| + |
| /// The pattern to match against test names to decide which to run, or `null` |
| /// if all tests should be run. |
| final Pattern pattern; |
| @@ -117,7 +124,7 @@ class Configuration { |
| bool pauseAfterLoad, bool color, String packageRoot, String reporter, |
| int pubServePort, int concurrency, Timeout timeout, this.pattern, |
| Iterable<TestPlatform> platforms, Iterable<String> paths, |
| - Iterable<String> tags, Iterable<String> excludeTags}) |
| + Glob filename, Iterable<String> tags, Iterable<String> excludeTags}) |
| : _help = help, |
| _version = version, |
| _verboseTrace = verboseTrace, |
| @@ -135,8 +142,15 @@ class Configuration { |
| : (timeout == null ? new Timeout.factor(1) : timeout), |
| _platforms = _list(platforms), |
| _paths = _list(paths), |
| + _filename = filename, |
|
kevmoo
2016/02/04 17:50:05
Set the final field here instead of doing the null
nweiz
2016/02/04 20:06:47
It's important to be able to differentiate between
|
| tags = tags?.toSet() ?? new Set(), |
| - excludeTags = excludeTags?.toSet() ?? new Set(); |
| + excludeTags = excludeTags?.toSet() ?? new Set() { |
| + if (_filename != null && _filename.context.style != p.style) { |
| + throw new ArgumentError( |
| + "filename's context must match the current operating system, was " |
| + "${_filename.context.style}."); |
| + } |
| + } |
| /// Returns a [input] as a list or `null`. |
| /// |
| @@ -169,6 +183,7 @@ class Configuration { |
| pattern: other.pattern ?? pattern, |
| platforms: other._platforms ?? _platforms, |
| paths: other._paths ?? _paths, |
| + filename: other._filename ?? _filename, |
| tags: other.tags.union(tags), |
| excludeTags: other.excludeTags.union(excludeTags)); |
| } |