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

Unified Diff: example/test_runner.dart

Issue 849023002: format code, removed unused variables and deprecated usage (Closed) Base URL: https://github.com/dart-lang/args.git@master
Patch Set: nits Created 5 years, 11 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 | « CHANGELOG.md ('k') | lib/command_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: example/test_runner.dart
diff --git a/example/test_runner.dart b/example/test_runner.dart
index fac1690b9fba0200dcde18878046ac22d1d14950..9480f417212a77ab21ecf764c394559af96f87f0 100644
--- a/example/test_runner.dart
+++ b/example/test_runner.dart
@@ -14,92 +14,125 @@ import 'package:args/args.dart';
main() {
var parser = new ArgParser();
- parser.addOption('mode', abbr: 'm', defaultsTo: 'debug',
+ parser.addOption('mode',
+ abbr: 'm',
+ defaultsTo: 'debug',
help: 'Mode in which to run the tests',
allowed: ['all', 'debug', 'release']);
- parser.addOption('compiler', abbr: 'c', defaultsTo: 'none',
+ parser.addOption('compiler',
+ abbr: 'c',
+ defaultsTo: 'none',
help: 'Specify any compilation step (if needed).',
allowed: ['none', 'dart2js', 'dartc'],
allowedHelp: {
- 'none': 'Do not compile the Dart code (run native Dart code on the'
- ' VM).\n(only valid with the following runtimes: vm, drt)',
- 'dart2js': 'Compile dart code to JavaScript by running dart2js.\n'
- '(only valid with the following runtimes: d8, drt, chrome\n'
- 'safari, ie, firefox, opera, none (compile only))',
- 'dartc': 'Perform static analysis on Dart code by running dartc.\n'
- '(only valid with the following runtimes: none)',
- });
-
- parser.addOption('runtime', abbr: 'r', defaultsTo: 'vm',
+ 'none': 'Do not compile the Dart code (run native Dart code on the'
+ ' VM).\n(only valid with the following runtimes: vm, drt)',
+ 'dart2js': 'Compile dart code to JavaScript by running dart2js.\n'
+ '(only valid with the following runtimes: d8, drt, chrome\n'
+ 'safari, ie, firefox, opera, none (compile only))',
+ 'dartc': 'Perform static analysis on Dart code by running dartc.\n'
+ '(only valid with the following runtimes: none)',
+ });
+
+ parser.addOption('runtime',
+ abbr: 'r',
+ defaultsTo: 'vm',
help: 'Where the tests should be run.',
- allowed: ['vm', 'd8', 'drt', 'dartium', 'ff', 'firefox', 'chrome',
- 'safari', 'ie', 'opera', 'none'],
+ allowed: [
+ 'vm',
+ 'd8',
+ 'drt',
+ 'dartium',
+ 'ff',
+ 'firefox',
+ 'chrome',
+ 'safari',
+ 'ie',
+ 'opera',
+ 'none'
+ ],
allowedHelp: {
- 'vm': 'Run Dart code on the standalone dart vm.',
- 'd8': 'Run JavaScript from the command line using v8.',
- // TODO(antonm): rename flag.
- 'drt': 'Run Dart or JavaScript in the headless version of Chrome,\n'
- 'content shell.',
- 'dartium': 'Run Dart or JavaScript in Dartium.',
- 'ff': 'Run JavaScript in Firefox',
- 'chrome': 'Run JavaScript in Chrome',
- 'safari': 'Run JavaScript in Safari',
- 'ie': 'Run JavaScript in Internet Explorer',
- 'opera': 'Run JavaScript in Opera',
- 'none': 'No runtime, compile only (for example, used for dartc static\n'
- 'analysis tests).',
- });
-
- parser.addOption('arch', abbr: 'a', defaultsTo: 'ia32',
+ 'vm': 'Run Dart code on the standalone dart vm.',
+ 'd8': 'Run JavaScript from the command line using v8.',
+ // TODO(antonm): rename flag.
+ 'drt': 'Run Dart or JavaScript in the headless version of Chrome,\n'
+ 'content shell.',
+ 'dartium': 'Run Dart or JavaScript in Dartium.',
+ 'ff': 'Run JavaScript in Firefox',
+ 'chrome': 'Run JavaScript in Chrome',
+ 'safari': 'Run JavaScript in Safari',
+ 'ie': 'Run JavaScript in Internet Explorer',
+ 'opera': 'Run JavaScript in Opera',
+ 'none': 'No runtime, compile only (for example, used for dartc static\n'
+ 'analysis tests).',
+ });
+
+ parser.addOption('arch',
+ abbr: 'a',
+ defaultsTo: 'ia32',
help: 'The architecture to run tests for',
allowed: ['all', 'ia32', 'x64', 'simarm']);
- parser.addOption('system', abbr: 's', defaultsTo: Platform.operatingSystem,
+ parser.addOption('system',
+ abbr: 's',
+ defaultsTo: Platform.operatingSystem,
help: 'The operating system to run tests on',
allowed: ['linux', 'macos', 'windows']);
- parser.addFlag('checked', defaultsTo: false,
- help: 'Run tests in checked mode');
+ parser.addFlag('checked',
+ defaultsTo: false, help: 'Run tests in checked mode');
- parser.addFlag('host-checked', defaultsTo: false,
- help: 'Run compiler in checked mode');
+ parser.addFlag('host-checked',
+ defaultsTo: false, help: 'Run compiler in checked mode');
- parser.addOption('timeout', abbr: 't',
- help: 'Timeout in seconds');
+ parser.addOption('timeout', abbr: 't', help: 'Timeout in seconds');
- parser.addOption('progress', abbr: 'p', defaultsTo: 'compact',
+ parser.addOption('progress',
+ abbr: 'p',
+ defaultsTo: 'compact',
help: 'Progress indication mode',
- allowed: ['compact', 'color', 'line', 'verbose', 'silent', 'status',
- 'buildbot']);
-
- parser.addFlag('report', defaultsTo: false,
+ allowed: [
+ 'compact',
+ 'color',
+ 'line',
+ 'verbose',
+ 'silent',
+ 'status',
+ 'buildbot'
+ ]);
+
+ parser.addFlag('report',
+ defaultsTo: false,
help: 'Print a summary report of the number of tests, by expectation');
- parser.addOption('tasks', abbr: 'j',
+ parser.addOption('tasks',
+ abbr: 'j',
defaultsTo: Platform.numberOfProcessors.toString(),
help: 'The number of parallel tasks to run');
- parser.addOption('shards', defaultsTo: '1',
+ parser.addOption('shards',
+ defaultsTo: '1',
help: 'The number of instances that the tests will be sharded over');
- parser.addOption('shard', defaultsTo: '1',
+ parser.addOption('shard',
+ defaultsTo: '1',
help: 'The index of this instance when running in sharded mode');
- parser.addFlag('verbose', abbr: 'v', defaultsTo: false,
- help: 'Verbose output');
+ parser.addFlag('verbose',
+ abbr: 'v', defaultsTo: false, help: 'Verbose output');
- parser.addFlag('list', defaultsTo: false,
- help: 'List tests only, do not run them');
+ parser.addFlag('list',
+ defaultsTo: false, help: 'List tests only, do not run them');
- parser.addFlag('keep-generated-tests', defaultsTo: false,
+ parser.addFlag('keep-generated-tests',
+ defaultsTo: false,
help: 'Keep the generated files in the temporary directory');
- parser.addFlag('valgrind', defaultsTo: false,
- help: 'Run tests through valgrind');
+ parser.addFlag('valgrind',
+ defaultsTo: false, help: 'Run tests through valgrind');
- parser.addOption('special-command',
- help: """
+ parser.addOption('special-command', help: """
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
@@ -111,16 +144,14 @@ is 'dart file.dart' and you specify special command
'python -u valgrind.py dart file.dart suffix'""");
parser.addFlag('time',
- help: 'Print timing information after running tests',
- defaultsTo: false);
+ help: 'Print timing information after running tests', defaultsTo: false);
- parser.addOption('dart', help: 'Path to dart executable');
- parser.addOption('drt', help: 'Path to content shell executable');
+ parser.addOption('dart', help: 'Path to dart executable');
+ parser.addOption('drt', help: 'Path to content shell executable');
parser.addOption('dartium', help: 'Path to Dartium Chrome executable');
- parser.addFlag('batch', abbr: 'b',
- help: 'Run browser tests in batch mode',
- defaultsTo: true);
+ parser.addFlag('batch',
+ abbr: 'b', help: 'Run browser tests in batch mode', defaultsTo: true);
- print(parser.getUsage());
+ print(parser.usage);
}
« no previous file with comments | « CHANGELOG.md ('k') | lib/command_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698