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

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

Issue 9863057: Add DirectoryTestSuite. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Oops. Add changes. Created 8 years, 8 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
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 #import("dart:io"); 7 #import("dart:io");
8 #import("dart:builtin"); 8 #import("dart:builtin");
9 #import("drt_updater.dart"); 9 #import("drt_updater.dart");
10 10
11 List<String> defaultTestSelectors = 11 List<String> defaultTestSelectors =
12 const ['dartc', 'samples', 'standalone', 'corelib', 'co19', 'language', 12 const ['dartc', 'samples', 'standalone', 'corelib', 'co19', 'language',
13 'isolate', 'vm', 'client', 'dartdoc', 'utils']; 13 'isolate', 'vm', 'client', 'dartdoc', 'utils', 'pub'];
14 14
15 /** 15 /**
16 * Specification of a single test option. 16 * Specification of a single test option.
17 * 17 *
18 * The name of the specification is used as the key for the option in 18 * The name of the specification is used as the key for the option in
19 * the Map returned from the [TestOptionParser] parse method. 19 * the Map returned from the [TestOptionParser] parse method.
20 */ 20 */
21 class _TestOptionSpecification { 21 class _TestOptionSpecification {
22 _TestOptionSpecification(this.name, 22 _TestOptionSpecification(this.name,
23 this.description, 23 this.description,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 frog: Compile dart code to JavaScript by running the frog compiler. 71 frog: Compile dart code to JavaScript by running the frog compiler.
72 (only valid with the following runtimes: d8, drt, chrome, safari, ie, 72 (only valid with the following runtimes: d8, drt, chrome, safari, ie,
73 firefox, opera, none (compile only)) 73 firefox, opera, none (compile only))
74 74
75 dart2js: Compile dart code to JavaScript by running dart2js (leg). 75 dart2js: Compile dart code to JavaScript by running dart2js (leg).
76 (only valid with the following runtimes: same as frog) 76 (only valid with the following runtimes: same as frog)
77 77
78 dartc: Perform static analysis on Dart code by running dartc. 78 dartc: Perform static analysis on Dart code by running dartc.
79 (only valid with the following runtimes: none) 79 (only valid with the following runtimes: none)
80 80
81 frogsh: Compile dart code to JavaScript by running the frog compiler on 81 frogsh: Compile dart code to JavaScript by running the frog compiler on
82 node.js, and run the resulting JavaScript on the same instance of 82 node.js, and run the resulting JavaScript on the same instance of
83 node.js. 83 node.js.
84 (only valid with the following runtimes: same as frog)''', 84 (only valid with the following runtimes: same as frog)''',
85 ['-c', '--compiler'], 85 ['-c', '--compiler'],
86 ['none', 'frog', 'dart2js', 'dartc', 'frogsh'], 86 ['none', 'frog', 'dart2js', 'dartc', 'frogsh'],
87 'none'), 87 'none'),
88 new _TestOptionSpecification( 88 new _TestOptionSpecification(
89 'runtime', 89 'runtime',
90 '''Where the tests should be run. 90 '''Where the tests should be run.
91 vm: Run Dart code on the standalone dart vm. 91 vm: Run Dart code on the standalone dart vm.
92 92
93 d8: Run JavaScript from the command line using v8. 93 d8: Run JavaScript from the command line using v8.
94 94
95 drt: Run Dart or JavaScript in the headless version of Chrome, 95 drt: Run Dart or JavaScript in the headless version of Chrome,
96 DumpRenderTree. 96 DumpRenderTree.
97 97
98 ff or firefox: Run JavaScript in Firefox. 98 ff or firefox: Run JavaScript in Firefox.
99 99
100 chrome: Run JavaScript in Chrome. 100 chrome: Run JavaScript in Chrome.
101 101
102 safari: Run JavaScript in Safari. 102 safari: Run JavaScript in Safari.
103 103
104 ie: Run JavaScript in Internet Explorer. 104 ie: Run JavaScript in Internet Explorer.
105 105
106 opera: Run JavaScript in Opera. 106 opera: Run JavaScript in Opera.
107 107
108 none: No runtime, compile only (for example, used for dartc static analysis 108 none: No runtime, compile only (for example, used for dartc static analysis
109 tests).''', 109 tests).''',
110 ['-r', '--runtime'], 110 ['-r', '--runtime'],
111 ['vm', 'd8', 'drt', 'ff', 'firefox', 'chrome', 111 ['vm', 'd8', 'drt', 'ff', 'firefox', 'chrome',
112 'safari', 'ie', 'opera', 'none'], 112 'safari', 'ie', 'opera', 'none'],
113 'vm'), 113 'vm'),
114 new _TestOptionSpecification( 114 new _TestOptionSpecification(
115 'arch', 115 'arch',
116 'The architecture to run tests for', 116 'The architecture to run tests for',
117 ['-a', '--arch'], 117 ['-a', '--arch'],
118 ['all', 'ia32', 'x64', 'simarm'], 118 ['all', 'ia32', 'x64', 'simarm'],
119 'ia32'), 119 'ia32'),
120 new _TestOptionSpecification( 120 new _TestOptionSpecification(
121 'system', 121 'system',
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 case 'dartc': 379 case 'dartc':
380 isValid = config['runtime'] == 'none'; 380 isValid = config['runtime'] == 'none';
381 break; 381 break;
382 case 'none': 382 case 'none':
383 isValid = (const ['vm', 'drt']).indexOf(config['runtime']) >= 0; 383 isValid = (const ['vm', 'drt']).indexOf(config['runtime']) >= 0;
384 } 384 }
385 if (!isValid) { 385 if (!isValid) {
386 print("Warning: combination of ${config['compiler']} and " + 386 print("Warning: combination of ${config['compiler']} and " +
387 "${config['runtime']} is invalid. Skipping this combination."); 387 "${config['runtime']} is invalid. Skipping this combination.");
388 } 388 }
389 if (config['runtime'] == 'ie' && 389 if (config['runtime'] == 'ie' &&
390 new Platform().operatingSystem() != 'windows') { 390 new Platform().operatingSystem() != 'windows') {
391 isValid = false; 391 isValid = false;
392 print("Warning cannot run Internet Explorer on non-Windows operating" + 392 print("Warning cannot run Internet Explorer on non-Windows operating" +
393 " system."); 393 " system.");
394 } 394 }
395 return isValid; 395 return isValid;
396 } 396 }
397 397
398 /** 398 /**
399 * Recursively expand a configuration with multiple values per key 399 * Recursively expand a configuration with multiple values per key
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 467
468 // Expand the architectures. 468 // Expand the architectures.
469 if (configuration['arch'].contains(',')) { 469 if (configuration['arch'].contains(',')) {
470 return _expandHelper('arch', configuration); 470 return _expandHelper('arch', configuration);
471 } 471 }
472 472
473 // Expand modes. 473 // Expand modes.
474 if (configuration['mode'].contains(',')) { 474 if (configuration['mode'].contains(',')) {
475 return _expandHelper('mode', configuration); 475 return _expandHelper('mode', configuration);
476 } 476 }
477 477
478 // Expand compilers. 478 // Expand compilers.
479 if (configuration['compiler'].contains(',')) { 479 if (configuration['compiler'].contains(',')) {
480 return _expandHelper('compiler', configuration); 480 return _expandHelper('compiler', configuration);
481 } 481 }
482 482
483 // Expand runtimes. 483 // Expand runtimes.
484 var runtimes = configuration['runtime']; 484 var runtimes = configuration['runtime'];
485 if (runtimes.contains(',')) { 485 if (runtimes.contains(',')) {
486 return _expandHelper('runtime', configuration); 486 return _expandHelper('runtime', configuration);
487 } else { 487 } else {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 timeout *= 4; 519 timeout *= 4;
520 } 520 }
521 break; 521 break;
522 } 522 }
523 configuration['timeout'] = timeout; 523 configuration['timeout'] = timeout;
524 } 524 }
525 525
526 return [configuration]; 526 return [configuration];
527 } 527 }
528 528
529 /** 529 /**
530 * Helper for _expandConfigurations. Creates a new configuration and adds it 530 * Helper for _expandConfigurations. Creates a new configuration and adds it
531 * to a list, for use in a case when a particular configuration has multiple 531 * to a list, for use in a case when a particular configuration has multiple
532 * results (separated by a ','). 532 * results (separated by a ',').
533 * Arguments: 533 * Arguments:
534 * option: The particular test option we are expanding. 534 * option: The particular test option we are expanding.
535 * configuration: The map containing all test configuration information 535 * configuration: The map containing all test configuration information
536 * specified. 536 * specified.
537 */ 537 */
538 List<Map> _expandHelper(String option, Map configuration) { 538 List<Map> _expandHelper(String option, Map configuration) {
539 var result = new List<Map>(); 539 var result = new List<Map>();
540 var configs = configuration[option]; 540 var configs = configuration[option];
541 for (var config in configs.split(',')) { 541 for (var config in configs.split(',')) {
542 var newConfiguration = new Map.from(configuration); 542 var newConfiguration = new Map.from(configuration);
543 newConfiguration[option] = config; 543 newConfiguration[option] = config;
544 result.addAll(_expandConfigurations(newConfiguration)); 544 result.addAll(_expandConfigurations(newConfiguration));
545 } 545 }
546 return result; 546 return result;
547 } 547 }
548 548
549 549
550 /** 550 /**
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 return option; 594 return option;
595 } 595 }
596 } 596 }
597 print('Unknown test option $name'); 597 print('Unknown test option $name');
598 exit(1); 598 exit(1);
599 } 599 }
600 600
601 601
602 List<_TestOptionSpecification> _options; 602 List<_TestOptionSpecification> _options;
603 } 603 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698