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

Unified Diff: lib/src/runner/configuration.dart

Issue 1668573003: Add configuration support for choosing test paths. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: cr Created 4 years, 10 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/load.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/configuration.dart
diff --git a/lib/src/runner/configuration.dart b/lib/src/runner/configuration.dart
index 28f42788636b964fc87e35d648c96ab29b377b56..018952c26c667deacd75630dcc0436cd8d3e6c14 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 ?? defaultFilename;
+ 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,
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));
}
« no previous file with comments | « doc/package_config.md ('k') | lib/src/runner/configuration/load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698