| OLD | NEW | 
|---|
| 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("drt_updater.dart"); | 8 #import("drt_updater.dart"); | 
| 9 #import("test_suite.dart"); | 9 #import("test_suite.dart"); | 
| 10 | 10 | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 64           new _TestOptionSpecification( | 64           new _TestOptionSpecification( | 
| 65               'compiler', | 65               'compiler', | 
| 66               '''Specify any compilation step (if needed). | 66               '''Specify any compilation step (if needed). | 
| 67 | 67 | 
| 68    none: Do not compile the Dart code (run native Dart code on the VM). | 68    none: Do not compile the Dart code (run native Dart code on the VM). | 
| 69          (only valid with the following runtimes: vm, drt) | 69          (only valid with the following runtimes: vm, drt) | 
| 70 | 70 | 
| 71    dart2dart: Compile Dart code to Dart code | 71    dart2dart: Compile Dart code to Dart code | 
| 72               (only valid with the following runtimes: vm, drt) | 72               (only valid with the following runtimes: vm, drt) | 
| 73 | 73 | 
| 74    dart2js: Compile dart code to JavaScript by running dart2js (leg). | 74    dart2js: Compile dart code to JavaScript by running dart2js. | 
| 75             (only valid with the following runtimes: same as frog) | 75          (only valid with the following runtimes: d8, drt, chrome, | 
|  | 76          safari, ie, firefox, opera, none (compile only)), | 
| 76 | 77 | 
| 77    dartc: Perform static analysis on Dart code by running dartc. | 78    dartc: Perform static analysis on Dart code by running dartc. | 
| 78           (only valid with the following runtimes: none) | 79           (only valid with the following runtimes: none)''', | 
| 79 |  | 
| 80    frog: (DEPRECATED) Compile dart code to JavaScript by running the |  | 
| 81          frog compiler. (only valid with the following runtimes: d8, |  | 
| 82          drt, chrome, safari, ie, firefox, opera, none (compile only))''', |  | 
| 83               ['-c', '--compiler'], | 80               ['-c', '--compiler'], | 
| 84               ['none', 'dart2dart', 'frog', 'dart2js', 'dartc'], | 81               ['none', 'dart2dart', 'dart2js', 'dartc'], | 
| 85               'none'), | 82               'none'), | 
| 86           new _TestOptionSpecification( | 83           new _TestOptionSpecification( | 
| 87               'runtime', | 84               'runtime', | 
| 88               '''Where the tests should be run. | 85               '''Where the tests should be run. | 
| 89     vm: Run Dart code on the standalone dart vm. | 86     vm: Run Dart code on the standalone dart vm. | 
| 90 | 87 | 
| 91     d8: Run JavaScript from the command line using v8. | 88     d8: Run JavaScript from the command line using v8. | 
| 92 | 89 | 
| 93     drt: Run Dart or JavaScript in the headless version of Chrome, | 90     drt: Run Dart or JavaScript in the headless version of Chrome, | 
| 94          DumpRenderTree. | 91          DumpRenderTree. | 
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 207               [], | 204               [], | 
| 208               ''), | 205               ''), | 
| 209           new _TestOptionSpecification( | 206           new _TestOptionSpecification( | 
| 210               'time', | 207               'time', | 
| 211               'Print timing information after running tests', | 208               'Print timing information after running tests', | 
| 212               ['--time'], | 209               ['--time'], | 
| 213               [], | 210               [], | 
| 214               false, | 211               false, | 
| 215               'bool'), | 212               'bool'), | 
| 216           new _TestOptionSpecification( | 213           new _TestOptionSpecification( | 
| 217               'frog', |  | 
| 218               'Path to frog script or executable', |  | 
| 219               ['--frog'], |  | 
| 220               [], |  | 
| 221               ''), |  | 
| 222           new _TestOptionSpecification( |  | 
| 223               'dart', | 214               'dart', | 
| 224               'Path to dart executable', | 215               'Path to dart executable', | 
| 225               ['--dart'], | 216               ['--dart'], | 
| 226               [], | 217               [], | 
| 227               ''), | 218               ''), | 
| 228           new _TestOptionSpecification( | 219           new _TestOptionSpecification( | 
| 229               'drt', | 220               'drt', | 
| 230               'Path to DumpRenderTree executable', | 221               'Path to DumpRenderTree executable', | 
| 231               ['--drt'], | 222               ['--drt'], | 
| 232               [], | 223               [], | 
| 233               ''), | 224               ''), | 
| 234           new _TestOptionSpecification( | 225           new _TestOptionSpecification( | 
| 235               'dartium', | 226               'dartium', | 
| 236               'Path to Dartium Chrome executable', | 227               'Path to Dartium Chrome executable', | 
| 237               ['--dartium'], | 228               ['--dartium'], | 
| 238               [], | 229               [], | 
| 239               ''), | 230               ''), | 
| 240           new _TestOptionSpecification( | 231           new _TestOptionSpecification( | 
| 241               'froglib', |  | 
| 242               'Path to frog library', |  | 
| 243               ['--froglib'], |  | 
| 244               [], |  | 
| 245               ''), |  | 
| 246           new _TestOptionSpecification( |  | 
| 247               'use_sdk', | 232               'use_sdk', | 
| 248               '''Use compiler or runtime from the SDK. | 233               '''Use compiler or runtime from the SDK. | 
| 249 | 234 | 
| 250 Normally, the compiler or runtimes in PRODUCT_DIR is tested, with this | 235 Normally, the compiler or runtimes in PRODUCT_DIR is tested, with this | 
| 251 option, the compiler or runtime in PRODUCT_DIR/dart-sdk/bin is tested. | 236 option, the compiler or runtime in PRODUCT_DIR/dart-sdk/bin is tested. | 
| 252 | 237 | 
| 253 Note: currently only implemented for dart2js.''', | 238 Note: currently only implemented for dart2js.''', | 
| 254               ['--use-sdk'], | 239               ['--use-sdk'], | 
| 255               [], | 240               [], | 
| 256               false, | 241               false, | 
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 385   } | 370   } | 
| 386 | 371 | 
| 387   /** | 372   /** | 
| 388    * Determine if a particular configuration has a valid combination of compiler | 373    * Determine if a particular configuration has a valid combination of compiler | 
| 389    * and runtime elements. | 374    * and runtime elements. | 
| 390    */ | 375    */ | 
| 391   bool _isValidConfig(Map config) { | 376   bool _isValidConfig(Map config) { | 
| 392     bool isValid = true; | 377     bool isValid = true; | 
| 393     List<String> validRuntimes; | 378     List<String> validRuntimes; | 
| 394     switch (config['compiler']) { | 379     switch (config['compiler']) { | 
| 395       case 'frog': |  | 
| 396       case 'dart2js': | 380       case 'dart2js': | 
| 397         // Note: by adding 'none' as a configuration, if the user | 381         // Note: by adding 'none' as a configuration, if the user | 
| 398         // runs test.py -c dart2js -r drt,none the dart2js_none and | 382         // runs test.py -c dart2js -r drt,none the dart2js_none and | 
| 399         // dart2js_drt will be duplicating work. If later we don't need 'none' | 383         // dart2js_drt will be duplicating work. If later we don't need 'none' | 
| 400         // with dart2js, we should remove it from here. | 384         // with dart2js, we should remove it from here. | 
| 401         validRuntimes = const ['d8', 'drt', 'none', 'dartium', | 385         validRuntimes = const ['d8', 'drt', 'none', 'dartium', | 
| 402                                'ff', 'chrome', 'safari', 'ie', 'opera']; | 386                                'ff', 'chrome', 'safari', 'ie', 'opera']; | 
| 403         break; | 387         break; | 
| 404       case 'dartc': | 388       case 'dartc': | 
| 405         validRuntimes = const ['none']; | 389         validRuntimes = const ['none']; | 
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 642         return option; | 626         return option; | 
| 643       } | 627       } | 
| 644     } | 628     } | 
| 645     print('Unknown test option $name'); | 629     print('Unknown test option $name'); | 
| 646     exit(1); | 630     exit(1); | 
| 647   } | 631   } | 
| 648 | 632 | 
| 649 | 633 | 
| 650   List<_TestOptionSpecification> _options; | 634   List<_TestOptionSpecification> _options; | 
| 651 } | 635 } | 
| OLD | NEW | 
|---|