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

Unified Diff: dart/lib/unittest/unittest.dart

Issue 10632017: Revert "Added the ability to filter which tests are run by name, using a --filter argument passed t… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
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 | « dart/lib/unittest/config.dart ('k') | dart/tools/testing/dart/browser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/unittest/unittest.dart
diff --git a/dart/lib/unittest/unittest.dart b/dart/lib/unittest/unittest.dart
index cda3d48c3304990dcc930805748c942008329bd0..da7baaaf9b6844aa84a5b95e806c5eb00d6c5a2d 100644
--- a/dart/lib/unittest/unittest.dart
+++ b/dart/lib/unittest/unittest.dart
@@ -214,12 +214,6 @@ final _ERROR = 'error';
TestCase _soloTest;
/**
- * If set, then only tests whose descriptions match this regexp pattern
- * will be run.
- */
-String _filter = null;
-
-/**
* (Deprecated) Evaluates the [function] and validates that it throws an
* exception. If [callback] is provided, then it will be invoked with the
* thrown exception. The callback may do any validation it wants. In addition,
@@ -248,22 +242,6 @@ void expectThrow(function, [bool callback(exception)]) {
}
/**
- * Sets the regexp pattern filter which constrains which tests to run
- * based on their descriptions.
- */
-void setFilter(String filter) {
- if (filter == '') filter = null;
- _filter = filter;
-}
-
-/**
- * Gets the regexp pattern filter which constrains which tests to run
- * based on their descriptions.
- */
-String getFilter() {
- return _filter;
-}
-/**
* Creates a new test case with the given description and body. The
* description will include the descriptions of any surrounding group()
* calls.
@@ -657,43 +635,12 @@ _defer(void callback()) {
port.toSendPort().send(null, null);
}
-/** Check arguments for a --filter spec. */
-_getFilterFromArgs() {
- var options = new Options().arguments;
- if (options != null) {
- for (var i = 0; i < options.length; i++) {
- if (options[i].startsWith('--filter=')) {
- var filter = options[i].substring(9);
- if (filter.length > 0) {
- // Strip quotes if present.
- var last = filter.length - 1;
- if ((filter[0] == "'" && filter[last] == "'") ||
- (filter[0] == '"' && filter[last] == '"')) {
- filter = filter.substring(1, last);
- }
- if (filter.length > 0) {
- setFilter(filter);
- }
- }
- break;
- }
- }
- }
-}
-
/** Runs all queued tests, one at a time. */
_runTests() {
// If we are soloing a test, remove all the others.
if (_soloTest != null) {
_tests = _tests.filter((t) => t == _soloTest);
}
- if (_filter == null) {
- _getFilterFromArgs();
- }
- if (_filter != null) {
- RegExp re = new RegExp(_filter);
- _tests = _tests.filter((t) => re.hasMatch(t.description));
- }
_config.onStart();
« no previous file with comments | « dart/lib/unittest/config.dart ('k') | dart/tools/testing/dart/browser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698