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

Unified Diff: lib/unittest/unittest.dart

Issue 10662022: Unit test filtering. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « lib/unittest/config.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/unittest.dart
===================================================================
--- lib/unittest/unittest.dart (revision 9065)
+++ lib/unittest/unittest.dart (working copy)
@@ -242,6 +242,13 @@
}
/**
+ * The regexp pattern filter which constrains which tests to run
+ * based on their descriptions.
+ */
+
+String filter = null;
+
+/**
* Creates a new test case with the given description and body. The
* description will include the descriptions of any surrounding group()
* calls.
@@ -641,6 +648,10 @@
if (_soloTest != null) {
_tests = _tests.filter((t) => t == _soloTest);
}
+ if (filter != null) {
+ RegExp re = new RegExp(filter);
+ _tests = _tests.filter((t) => re.hasMatch(t.description));
+ }
_config.onStart();
« no previous file with comments | « lib/unittest/config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698