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

Unified Diff: tools/testing/dart/test_options.dart

Issue 8566001: Implement test selection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | « tests/standalone/test_config.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_options.dart
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index 44f0837968ab7543186fce5f14904c81a69e2f5f..ca8835f7bd88693616d98882f0dfbde237da7e43 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -4,6 +4,8 @@
#library("test_options_parser");
+List<String> defaultTestSelectors = const ['standalone', 'corelib'];
+
/**
* Specification of a single test option.
*
@@ -140,7 +142,7 @@ class TestOptionsParser {
// The option name does not start with '-' or '--' so we
// assume that the rest of the arguments specify tests or test
// suites to run.
- configuration['rest'] = arguments.getRange(i, numArguments - i);
+ configuration['patterns'] = arguments.getRange(i, numArguments - i);
return _expandConfigurations(configuration);
}
// Find the option specification for the name.
@@ -195,6 +197,20 @@ class TestOptionsParser {
configuration['component'] = 'vm,dartc';
}
+ // Expand the test selectors into simple regular expressions to be
+ // used on the full path of a test file. If no selectors are
+ // explicitly given use the default suite patterns.
+ List<String> patterns = configuration['patterns'];
+ if (patterns == null) {
+ patterns = new List.from(defaultTestSelectors);
+ }
+ for (var i = 0; i < patterns.length; i++) {
+ patterns[i] = patterns[i].replaceAll('*', '.*');
+ patterns[i] = patterns[i].replaceAll('/', '.*');
+ patterns[i] = new RegExp(patterns[i]);
Bill Hesse 2011/11/14 11:22:10 patterns has type List<String>.
Mads Ager (google) 2011/11/14 11:25:38 Yes, thanks!
+ }
+ configuration['patterns'] = patterns;
+
// Expand the architectures.
var archs = configuration['architecture'];
if (archs.contains(',')) {
« no previous file with comments | « tests/standalone/test_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698