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

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

Issue 8835010: Support --special-command test option. As a special case support --valgrind option. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comment. Created 9 years 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/stub-generator/test_config.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | 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 2d398f2ab4034332e4159cae2986e5ee3f75b749..36b8c870fe672c5fd3f0b31e171be168fcbbd50d 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -34,6 +34,18 @@ class _TestOptionSpecification {
* Parser of test options.
*/
class TestOptionsParser {
+ String specialCommandHelp =
+"""
+Special command support. Wraps the command line in
+a special command. The special command should contain
+an '@' character which will be replaced by the normal
+command.
+
+For example if the normal command that will be executed
+is 'dart file.dart' and you specify special command
+'python -u valgrind.py @ suffix' the final command will be
+'python -u valgrind.py dart file.dart suffix'""";
+
/**
* Creates a test options parser initialized with the known options.
*/
@@ -85,7 +97,7 @@ class TestOptionsParser {
'compact'),
new _TestOptionSpecification(
'report',
- 'Print a summary report of the number of tests, by expectation.',
+ 'Print a summary report of the number of tests, by expectation',
['--report'],
[],
false,
@@ -110,7 +122,20 @@ class TestOptionsParser {
['-v', '--verbose'],
[],
false,
- 'bool')];
+ 'bool'),
+ new _TestOptionSpecification(
+ 'valgrind',
+ 'Run tests through valgrind',
+ ['--valgrind'],
+ [],
+ false,
+ 'bool'),
+ new _TestOptionSpecification(
+ 'special-command',
+ specialCommandHelp,
+ ['--special-command'],
+ [],
+ '')];
}
@@ -236,6 +261,16 @@ class TestOptionsParser {
if (configuration['component'] == 'most') {
configuration['component'] = 'vm,dartc';
}
+ if (configuration['valgrind']) {
+ // TODO(ager): Get rid of this when there is only one checkout and
+ // we don't have to special case for the runtime checkout.
+ File valgrindFile = new File('runtime/tools/valgrind.py');
+ if (!valgrindFile.existsSync()) {
+ valgrindFile = new File('../runtime/tools/valgrind.py');
+ }
+ String valgrind = valgrindFile.fullPathSync();
+ configuration['special-command'] = 'python -u $valgrind @';
+ }
// Use verbose progress indication for verbose output.
if (configuration['verbose']) {
« no previous file with comments | « tests/stub-generator/test_config.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698