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

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

Issue 10887023: Use new try-catch syntax in runtime/, tools/, and utils/. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « runtime/tests/vm/dart/isolate_mirror_remote_test.dart ('k') | utils/apidoc/mdn/extract.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #import("dart:io"); 7 #import("dart:io");
8 #import("dart:math"); 8 #import("dart:math");
9 #import("drt_updater.dart"); 9 #import("drt_updater.dart");
10 #import("test_suite.dart"); 10 #import("test_suite.dart");
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 // Parse the value for the option. 339 // Parse the value for the option.
340 if (spec.type == 'bool') { 340 if (spec.type == 'bool') {
341 if (!value.isEmpty()) { 341 if (!value.isEmpty()) {
342 print('No value expected for bool option $name'); 342 print('No value expected for bool option $name');
343 exit(1); 343 exit(1);
344 } 344 }
345 configuration[spec.name] = true; 345 configuration[spec.name] = true;
346 } else if (spec.type == 'int') { 346 } else if (spec.type == 'int') {
347 try { 347 try {
348 configuration[spec.name] = parseInt(value); 348 configuration[spec.name] = parseInt(value);
349 } catch (var e) { 349 } catch (e) {
350 print('Integer value expected for int option $name'); 350 print('Integer value expected for int option $name');
351 exit(1); 351 exit(1);
352 } 352 }
353 } else { 353 } else {
354 assert(spec.type == 'string'); 354 assert(spec.type == 'string');
355 if (!spec.values.isEmpty()) { 355 if (!spec.values.isEmpty()) {
356 for (var v in value.split(',')) { 356 for (var v in value.split(',')) {
357 if (spec.values.lastIndexOf(v) == -1) { 357 if (spec.values.lastIndexOf(v) == -1) {
358 print('Unknown value ($v) for option $name'); 358 print('Unknown value ($v) for option $name');
359 exit(1); 359 exit(1);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 return option; 633 return option;
634 } 634 }
635 } 635 }
636 print('Unknown test option $name'); 636 print('Unknown test option $name');
637 exit(1); 637 exit(1);
638 } 638 }
639 639
640 640
641 List<_TestOptionSpecification> _options; 641 List<_TestOptionSpecification> _options;
642 } 642 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/isolate_mirror_remote_test.dart ('k') | utils/apidoc/mdn/extract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698