| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import "path.dart"; | 10 import "path.dart"; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 dart2js: Compile dart code to JavaScript by running dart2js. | 62 dart2js: Compile dart code to JavaScript by running dart2js. |
| 63 (only valid with the following runtimes: d8, drt, chrome, | 63 (only valid with the following runtimes: d8, drt, chrome, |
| 64 safari, ie9, ie10, ie11, firefox, opera, chromeOnAndroid, | 64 safari, ie9, ie10, ie11, firefox, opera, chromeOnAndroid, |
| 65 none (compile only)), | 65 none (compile only)), |
| 66 | 66 |
| 67 dartanalyzer: Perform static analysis on Dart code by running the analyzer on
Java. | 67 dartanalyzer: Perform static analysis on Dart code by running the analyzer on
Java. |
| 68 dart2analyzer: Perform static analysis on Dart code by running the analyzer o
n Dart. | 68 dart2analyzer: Perform static analysis on Dart code by running the analyzer o
n Dart. |
| 69 (only valid with the following runtimes: none)''', | 69 (only valid with the following runtimes: none)''', |
| 70 ['-c', '--compiler'], | 70 ['-c', '--compiler'], |
| 71 ['none', 'dart2js', 'dartanalyzer', 'dart2analyzer'], | 71 ['none', 'precompiler', |
| 72 'dart2js', 'dartanalyzer', 'dart2analyzer'], |
| 72 'none'), | 73 'none'), |
| 73 // TODO(antonm): fix the option drt. | 74 // TODO(antonm): fix the option drt. |
| 74 new _TestOptionSpecification( | 75 new _TestOptionSpecification( |
| 75 'runtime', | 76 'runtime', |
| 76 '''Where the tests should be run. | 77 '''Where the tests should be run. |
| 77 vm: Run Dart code on the standalone dart vm. | 78 vm: Run Dart code on the standalone dart vm. |
| 78 | 79 |
| 80 dart_precompiled: Run a precompiled snapshot on a variant of the standalone |
| 81 dart vm lacking a JIT. |
| 82 |
| 79 d8: Run JavaScript from the command line using v8. | 83 d8: Run JavaScript from the command line using v8. |
| 80 | 84 |
| 81 jsshell: Run JavaScript from the command line using firefox js-shell. | 85 jsshell: Run JavaScript from the command line using firefox js-shell. |
| 82 | 86 |
| 83 drt: Run Dart or JavaScript in the headless version of Chrome, | 87 drt: Run Dart or JavaScript in the headless version of Chrome, |
| 84 Content shell. | 88 Content shell. |
| 85 | 89 |
| 86 dartium: Run Dart or JavaScript in Dartium. | 90 dartium: Run Dart or JavaScript in Dartium. |
| 87 | 91 |
| 88 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell | 92 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell |
| 89 on Android. | 93 on Android. |
| 90 | 94 |
| 91 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. | 95 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. |
| 92 | 96 |
| 93 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: | 97 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: |
| 94 Run JavaScript in the specified browser. | 98 Run JavaScript in the specified browser. |
| 95 | 99 |
| 96 none: No runtime, compile only (for example, used for dartanalyzer static | 100 none: No runtime, compile only (for example, used for dartanalyzer static |
| 97 analysis tests).''', | 101 analysis tests).''', |
| 98 ['-r', '--runtime'], | 102 ['-r', '--runtime'], |
| 99 ['vm', 'd8', 'jsshell', 'drt', 'dartium', 'ff', 'firefox', | 103 ['vm', 'dart_precompiled', 'd8', 'jsshell', 'drt', 'dartium', |
| 104 'ff', 'firefox', |
| 100 'chrome', 'safari', 'ie9', 'ie10', 'ie11', 'opera', | 105 'chrome', 'safari', 'ie9', 'ie10', 'ie11', 'opera', |
| 101 'chromeOnAndroid', 'safarimobilesim', | 106 'chromeOnAndroid', 'safarimobilesim', |
| 102 'ContentShellOnAndroid', 'DartiumOnAndroid', 'none'], | 107 'ContentShellOnAndroid', 'DartiumOnAndroid', 'none'], |
| 103 'vm'), | 108 'vm'), |
| 104 new _TestOptionSpecification( | 109 new _TestOptionSpecification( |
| 105 'arch', | 110 'arch', |
| 106 'The architecture to run tests for', | 111 'The architecture to run tests for', |
| 107 ['-a', '--arch'], | 112 ['-a', '--arch'], |
| 108 ['all', 'ia32', 'x64', 'arm', 'armv5te', 'arm64', 'mips', | 113 ['all', 'ia32', 'x64', 'arm', 'armv5te', 'arm64', 'mips', |
| 109 'simarm', 'simarmv5te', 'simarm64', 'simmips'], | 114 'simarm', 'simarmv5te', 'simarm64', 'simmips'], |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 // dart2js_drt will be duplicating work. If later we don't need 'none' | 644 // dart2js_drt will be duplicating work. If later we don't need 'none' |
| 640 // with dart2js, we should remove it from here. | 645 // with dart2js, we should remove it from here. |
| 641 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', | 646 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', |
| 642 'ff', 'chrome', 'safari', 'ie9', 'ie10', 'ie11', | 647 'ff', 'chrome', 'safari', 'ie9', 'ie10', 'ie11', |
| 643 'opera', 'chromeOnAndroid', 'safarimobilesim']; | 648 'opera', 'chromeOnAndroid', 'safarimobilesim']; |
| 644 break; | 649 break; |
| 645 case 'dartanalyzer': | 650 case 'dartanalyzer': |
| 646 case 'dart2analyzer': | 651 case 'dart2analyzer': |
| 647 validRuntimes = const ['none']; | 652 validRuntimes = const ['none']; |
| 648 break; | 653 break; |
| 654 case 'precompiler': |
| 655 validRuntimes = const ['dart_precompiled']; |
| 656 break; |
| 649 case 'none': | 657 case 'none': |
| 650 validRuntimes = const ['vm', 'drt', 'dartium', | 658 validRuntimes = const ['vm', 'drt', 'dartium', |
| 651 'ContentShellOnAndroid', 'DartiumOnAndroid']; | 659 'ContentShellOnAndroid', 'DartiumOnAndroid']; |
| 652 break; | 660 break; |
| 653 } | 661 } |
| 654 if (!validRuntimes.contains(config['runtime'])) { | 662 if (!validRuntimes.contains(config['runtime'])) { |
| 655 isValid = false; | 663 isValid = false; |
| 656 print("Warning: combination of compiler '${config['compiler']}' and " | 664 print("Warning: combination of compiler '${config['compiler']}' and " |
| 657 "runtime '${config['runtime']}' is invalid. " | 665 "runtime '${config['runtime']}' is invalid. " |
| 658 "Skipping this combination."); | 666 "Skipping this combination."); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 return option; | 894 return option; |
| 887 } | 895 } |
| 888 } | 896 } |
| 889 print('Unknown test option $name'); | 897 print('Unknown test option $name'); |
| 890 exit(1); | 898 exit(1); |
| 891 } | 899 } |
| 892 | 900 |
| 893 | 901 |
| 894 List<_TestOptionSpecification> _options; | 902 List<_TestOptionSpecification> _options; |
| 895 } | 903 } |
| OLD | NEW |