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

Side by Side Diff: tools/testing/dart/test_options.dart

Issue 9109012: Fix static type warnings in test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/testing/dart/multitest.dart ('k') | tools/testing/dart/test_progress.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("test_options_parser"); 5 #library("test_options_parser");
6 6
7 List<String> defaultTestSelectors = 7 List<String> defaultTestSelectors =
8 const ['dartc', 'samples', 'standalone', 'corelib', 'co19', 'language', 8 const ['dartc', 'samples', 'standalone', 'corelib', 'co19', 'language',
9 'isolate', 'stub-generator', 'vm', 'client']; 9 'isolate', 'stub-generator', 'vm', 'client'];
10 10
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 void _printHelp() { 399 void _printHelp() {
400 print('usage: dart test.dart [options]\n'); 400 print('usage: dart test.dart [options]\n');
401 print('Options:\n'); 401 print('Options:\n');
402 for (var option in _options) { 402 for (var option in _options) {
403 print('${option.name}: ${option.description}.'); 403 print('${option.name}: ${option.description}.');
404 for (var name in option.keys) { 404 for (var name in option.keys) {
405 assert(name.startsWith('-')); 405 assert(name.startsWith('-'));
406 var buffer = new StringBuffer();; 406 var buffer = new StringBuffer();;
407 buffer.add(name); 407 buffer.add(name);
408 if (option.type == 'bool') { 408 if (option.type == 'bool') {
409 assert(option.values.empty()); 409 assert(option.values.isEmpty());
410 } else { 410 } else {
411 buffer.add(name.startsWith('--') ? '=' : ' '); 411 buffer.add(name.startsWith('--') ? '=' : ' ');
412 if (option.type == 'int') { 412 if (option.type == 'int') {
413 assert(option.values.empty()); 413 assert(option.values.isEmpty());
414 buffer.add('n (default: ${option.defaultValue})'); 414 buffer.add('n (default: ${option.defaultValue})');
415 } else { 415 } else {
416 buffer.add('['); 416 buffer.add('[');
417 bool first = true; 417 bool first = true;
418 for (var value in option.values) { 418 for (var value in option.values) {
419 if (!first) buffer.add(", "); 419 if (!first) buffer.add(", ");
420 if (value == option.defaultValue) buffer.add('*'); 420 if (value == option.defaultValue) buffer.add('*');
421 buffer.add(value); 421 buffer.add(value);
422 first = false; 422 first = false;
423 } 423 }
(...skipping 15 matching lines...) Expand all
439 if (option.keys.some((key) => key == name)) { 439 if (option.keys.some((key) => key == name)) {
440 return option; 440 return option;
441 } 441 }
442 } 442 }
443 return null; 443 return null;
444 } 444 }
445 445
446 446
447 List<_TestOptionSpecification> _options; 447 List<_TestOptionSpecification> _options;
448 } 448 }
OLDNEW
« no previous file with comments | « tools/testing/dart/multitest.dart ('k') | tools/testing/dart/test_progress.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698