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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 '''Specify any compilation step (if needed). | 57 '''Specify any compilation step (if needed). |
58 | 58 |
59 none: Do not compile the Dart code (run native Dart code on the VM). | 59 none: Do not compile the Dart code (run native Dart code on the VM). |
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 dartanalyzer: Perform static analysis on Dart code by running the analyzer on
Java. | 67 dart2analyzer: Perform static analysis on Dart code by running the analyzer |
68 dart2analyzer: Perform static analysis on Dart code by running the analyzer o
n Dart. | |
69 (only valid with the following runtimes: none)''', | 68 (only valid with the following runtimes: none)''', |
70 ['-c', '--compiler'], | 69 ['-c', '--compiler'], |
71 ['none', 'dart2js', 'dartanalyzer', 'dart2analyzer'], | 70 ['none', 'dart2js', 'dart2analyzer'], |
72 'none'), | 71 'none'), |
73 // TODO(antonm): fix the option drt. | 72 // TODO(antonm): fix the option drt. |
74 new _TestOptionSpecification( | 73 new _TestOptionSpecification( |
75 'runtime', | 74 'runtime', |
76 '''Where the tests should be run. | 75 '''Where the tests should be run. |
77 vm: Run Dart code on the standalone dart vm. | 76 vm: Run Dart code on the standalone dart vm. |
78 | 77 |
79 d8: Run JavaScript from the command line using v8. | 78 d8: Run JavaScript from the command line using v8. |
80 | 79 |
81 jsshell: Run JavaScript from the command line using firefox js-shell. | 80 jsshell: Run JavaScript from the command line using firefox js-shell. |
82 | 81 |
83 drt: Run Dart or JavaScript in the headless version of Chrome, | 82 drt: Run Dart or JavaScript in the headless version of Chrome, |
84 Content shell. | 83 Content shell. |
85 | 84 |
86 dartium: Run Dart or JavaScript in Dartium. | 85 dartium: Run Dart or JavaScript in Dartium. |
87 | 86 |
88 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell | 87 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell |
89 on Android. | 88 on Android. |
90 | 89 |
91 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. | 90 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. |
92 | 91 |
93 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: | 92 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: |
94 Run JavaScript in the specified browser. | 93 Run JavaScript in the specified browser. |
95 | 94 |
96 none: No runtime, compile only (for example, used for dartanalyzer static | 95 none: No runtime, compile only (for example, used for dart2analyzer static |
97 analysis tests).''', | 96 analysis tests).''', |
98 ['-r', '--runtime'], | 97 ['-r', '--runtime'], |
99 ['vm', 'd8', 'jsshell', 'drt', 'dartium', 'ff', 'firefox', | 98 ['vm', 'd8', 'jsshell', 'drt', 'dartium', 'ff', 'firefox', |
100 'chrome', 'safari', 'ie9', 'ie10', 'ie11', 'opera', | 99 'chrome', 'safari', 'ie9', 'ie10', 'ie11', 'opera', |
101 'chromeOnAndroid', 'safarimobilesim', | 100 'chromeOnAndroid', 'safarimobilesim', |
102 'ContentShellOnAndroid', 'DartiumOnAndroid', 'none'], | 101 'ContentShellOnAndroid', 'DartiumOnAndroid', 'none'], |
103 'vm'), | 102 'vm'), |
104 new _TestOptionSpecification( | 103 new _TestOptionSpecification( |
105 'arch', | 104 'arch', |
106 'The architecture to run tests for', | 105 'The architecture to run tests for', |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 switch (config['compiler']) { | 634 switch (config['compiler']) { |
636 case 'dart2js': | 635 case 'dart2js': |
637 // Note: by adding 'none' as a configuration, if the user | 636 // Note: by adding 'none' as a configuration, if the user |
638 // runs test.py -c dart2js -r drt,none the dart2js_none and | 637 // runs test.py -c dart2js -r drt,none the dart2js_none and |
639 // dart2js_drt will be duplicating work. If later we don't need 'none' | 638 // dart2js_drt will be duplicating work. If later we don't need 'none' |
640 // with dart2js, we should remove it from here. | 639 // with dart2js, we should remove it from here. |
641 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', | 640 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', |
642 'ff', 'chrome', 'safari', 'ie9', 'ie10', 'ie11', | 641 'ff', 'chrome', 'safari', 'ie9', 'ie10', 'ie11', |
643 'opera', 'chromeOnAndroid', 'safarimobilesim']; | 642 'opera', 'chromeOnAndroid', 'safarimobilesim']; |
644 break; | 643 break; |
645 case 'dartanalyzer': | |
646 case 'dart2analyzer': | 644 case 'dart2analyzer': |
647 validRuntimes = const ['none']; | 645 validRuntimes = const ['none']; |
648 break; | 646 break; |
649 case 'none': | 647 case 'none': |
650 validRuntimes = const ['vm', 'drt', 'dartium', | 648 validRuntimes = const ['vm', 'drt', 'dartium', |
651 'ContentShellOnAndroid', 'DartiumOnAndroid']; | 649 'ContentShellOnAndroid', 'DartiumOnAndroid']; |
652 break; | 650 break; |
653 } | 651 } |
654 if (!validRuntimes.contains(config['runtime'])) { | 652 if (!validRuntimes.contains(config['runtime'])) { |
655 isValid = false; | 653 isValid = false; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 return option; | 884 return option; |
887 } | 885 } |
888 } | 886 } |
889 print('Unknown test option $name'); | 887 print('Unknown test option $name'); |
890 exit(1); | 888 exit(1); |
891 } | 889 } |
892 | 890 |
893 | 891 |
894 List<_TestOptionSpecification> _options; | 892 List<_TestOptionSpecification> _options; |
895 } | 893 } |
OLD | NEW |