Chromium Code Reviews| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 ['-m', '--mode'], | 62 ['-m', '--mode'], |
| 63 ['all', 'debug', 'release'], | 63 ['all', 'debug', 'release'], |
| 64 'debug'), | 64 'debug'), |
| 65 new _TestOptionSpecification( | 65 new _TestOptionSpecification( |
| 66 'compiler', | 66 'compiler', |
| 67 '''Specify any compilation step (if needed). | 67 '''Specify any compilation step (if needed). |
| 68 | 68 |
| 69 none: Do not compile the Dart code (run native Dart code on the VM). | 69 none: Do not compile the Dart code (run native Dart code on the VM). |
| 70 (only valid with the following runtimes: vm, drt) | 70 (only valid with the following runtimes: vm, drt) |
| 71 | 71 |
| 72 dart2dart: Compile Dart code to Dart code | |
| 73 (only valid with the following runtimes: vm, drt) | |
| 74 | |
| 72 dart2js: Compile dart code to JavaScript by running dart2js (leg). | 75 dart2js: Compile dart code to JavaScript by running dart2js (leg). |
| 73 (only valid with the following runtimes: same as frog) | 76 (only valid with the following runtimes: same as frog) |
| 74 | 77 |
| 75 dartc: Perform static analysis on Dart code by running dartc. | 78 dartc: Perform static analysis on Dart code by running dartc. |
| 76 (only valid with the following runtimes: none) | 79 (only valid with the following runtimes: none) |
| 77 | 80 |
| 78 frog: (DEPRECATED) Compile dart code to JavaScript by running the | 81 frog: (DEPRECATED) Compile dart code to JavaScript by running the |
| 79 frog compiler. (only valid with the following runtimes: d8, | 82 frog compiler. (only valid with the following runtimes: d8, |
| 80 drt, chrome, safari, ie, firefox, opera, none (compile only))''', | 83 drt, chrome, safari, ie, firefox, opera, none (compile only))''', |
| 81 ['-c', '--compiler'], | 84 ['-c', '--compiler'], |
| 82 ['none', 'frog', 'dart2js', 'dartc'], | 85 ['none', 'dart2dart', 'frog', 'dart2js', 'dartc'], |
| 83 'none'), | 86 'none'), |
| 84 new _TestOptionSpecification( | 87 new _TestOptionSpecification( |
| 85 'runtime', | 88 'runtime', |
| 86 '''Where the tests should be run. | 89 '''Where the tests should be run. |
| 87 vm: Run Dart code on the standalone dart vm. | 90 vm: Run Dart code on the standalone dart vm. |
| 88 | 91 |
| 89 d8: Run JavaScript from the command line using v8. | 92 d8: Run JavaScript from the command line using v8. |
| 90 | 93 |
| 91 drt: Run Dart or JavaScript in the headless version of Chrome, | 94 drt: Run Dart or JavaScript in the headless version of Chrome, |
| 92 DumpRenderTree. | 95 DumpRenderTree. |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 // dart2js_drt will be duplicating work. If later we don't need 'none' | 399 // dart2js_drt will be duplicating work. If later we don't need 'none' |
| 397 // with dart2js, we should remove it from here. | 400 // with dart2js, we should remove it from here. |
| 398 isValid = (const ['d8', 'drt', 'dartium', 'ff', | 401 isValid = (const ['d8', 'drt', 'dartium', 'ff', |
| 399 'chrome', 'safari', 'ie', 'opera', | 402 'chrome', 'safari', 'ie', 'opera', |
| 400 'none']).indexOf(config['runtime']) >= 0; | 403 'none']).indexOf(config['runtime']) >= 0; |
| 401 break; | 404 break; |
| 402 case 'dartc': | 405 case 'dartc': |
| 403 isValid = config['runtime'] == 'none'; | 406 isValid = config['runtime'] == 'none'; |
| 404 break; | 407 break; |
| 405 case 'none': | 408 case 'none': |
| 409 case 'dart2dart': | |
|
Bill Hesse
2012/07/24 11:58:59
See below.
const ['vm', 'drt', 'dartium'].some(equ
Anton Muhin
2012/07/25 11:19:57
Done.
| |
| 406 isValid = (const ['vm', 'drt', | 410 isValid = (const ['vm', 'drt', |
| 407 'dartium']).indexOf(config['runtime']) >= 0; | 411 'dartium']).indexOf(config['runtime']) >= 0; |
| 408 } | 412 } |
| 409 if (!isValid) { | 413 if (!isValid) { |
| 410 print("Warning: combination of ${config['compiler']} and " | 414 print("Warning: combination of ${config['compiler']} and " |
| 411 "${config['runtime']} is invalid. Skipping this combination."); | 415 "${config['runtime']} is invalid. Skipping this combination."); |
| 412 } | 416 } |
| 413 if (config['runtime'] == 'ie' && | 417 if (config['runtime'] == 'ie' && |
| 414 Platform.operatingSystem != 'windows') { | 418 Platform.operatingSystem != 'windows') { |
| 415 isValid = false; | 419 isValid = false; |
| 416 print("Warning cannot run Internet Explorer on non-Windows operating" | 420 print("Warning cannot run Internet Explorer on non-Windows operating" |
| 417 " system."); | 421 " system."); |
| 418 } | 422 } |
| 419 if (config['shard'] < 1 || config['shard'] > config['shards']) { | 423 if (config['shard'] < 1 || config['shard'] > config['shards']) { |
| 420 isValid = false; | 424 isValid = false; |
| 421 print("Error: shard index is ${config['shard']} out of " | 425 print("Error: shard index is ${config['shard']} out of " |
| 422 "${config['shards']} shards"); | 426 "${config['shards']} shards"); |
| 423 } | 427 } |
| 424 if (config['runtime'] == 'dartium' && config['compiler'] == 'none' && | 428 if (config['runtime'] == 'dartium' && |
|
Bill Hesse
2012/07/24 11:58:59
Please put a TODO(1030) here, to fix this when Col
| |
| 429 const ['none', 'dart2dart'].indexOf(config['compiler']) >= 0 && | |
| 425 config['checked']) { | 430 config['checked']) { |
| 426 // TODO(vsm): Set the DART_FLAGS environment appropriately when | 431 // TODO(vsm): Set the DART_FLAGS environment appropriately when |
| 427 // invoking Selenium to support checked mode. It's not clear | 432 // invoking Selenium to support checked mode. It's not clear |
| 428 // the current selenium API supports this. | 433 // the current selenium API supports this. |
| 429 isValid = false; | 434 isValid = false; |
| 430 print("Warning: checked mode is not yet supported for dartium tests."); | 435 print("Warning: checked mode is not yet supported for dartium tests."); |
| 431 } | 436 } |
| 432 return isValid; | 437 return isValid; |
| 433 } | 438 } |
| 434 | 439 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 638 return option; | 643 return option; |
| 639 } | 644 } |
| 640 } | 645 } |
| 641 print('Unknown test option $name'); | 646 print('Unknown test option $name'); |
| 642 exit(1); | 647 exit(1); |
| 643 } | 648 } |
| 644 | 649 |
| 645 | 650 |
| 646 List<_TestOptionSpecification> _options; | 651 List<_TestOptionSpecification> _options; |
| 647 } | 652 } |
| OLD | NEW |