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