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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 dartk: Compile the Dart source into Kernel before running test. | 81 dartk: Compile the Dart source into Kernel before running test. |
82 | 82 |
83 dartkp: Compiler the Dart source into Kernel and then Kernel into AOT | 83 dartkp: Compiler the Dart source into Kernel and then Kernel into AOT |
84 snapshot before running the test.''', | 84 snapshot before running the test.''', |
85 ['-c', '--compiler'], | 85 ['-c', '--compiler'], |
86 [ | 86 [ |
87 'none', | 87 'none', |
88 'precompiler', | 88 'precompiler', |
89 'dart2js', | 89 'dart2js', |
90 'dart2analyzer', | 90 'dart2analyzer', |
91 'dart2app', | 91 'app_jit', |
92 'dart2appjit', | 92 'dart2app', // TODO(rmacnak): Remove after updating bots. |
| 93 'dart2appjit', // TODO(rmacnak): Remove after updating bots. |
93 'dartk', | 94 'dartk', |
94 'dartkp' | 95 'dartkp' |
95 ], | 96 ], |
96 'none'), | 97 'none'), |
97 // TODO(antonm): fix the option drt. | 98 // TODO(antonm): fix the option drt. |
98 new _TestOptionSpecification( | 99 new _TestOptionSpecification( |
99 'runtime', | 100 'runtime', |
100 '''Where the tests should be run. | 101 '''Where the tests should be run. |
101 vm: Run Dart code on the standalone dart vm. | 102 vm: Run Dart code on the standalone dart vm. |
102 | 103 |
103 dart_precompiled: Run a precompiled snapshot on a variant of the standalone | 104 dart_precompiled: Run a precompiled snapshot on a variant of the standalone |
104 dart vm lacking a JIT. | 105 dart vm lacking a JIT. |
105 | 106 |
106 dart_app: Run a full app snapshot, with or without cached unoptimized code. | |
107 | |
108 d8: Run JavaScript from the command line using v8. | 107 d8: Run JavaScript from the command line using v8. |
109 | 108 |
110 jsshell: Run JavaScript from the command line using firefox js-shell. | 109 jsshell: Run JavaScript from the command line using firefox js-shell. |
111 | 110 |
112 drt: Run Dart or JavaScript in the headless version of Chrome, | 111 drt: Run Dart or JavaScript in the headless version of Chrome, |
113 Content shell. | 112 Content shell. |
114 | 113 |
115 dartium: Run Dart or JavaScript in Dartium. | 114 dartium: Run Dart or JavaScript in Dartium. |
116 | 115 |
117 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell | 116 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell |
118 on Android. | 117 on Android. |
119 | 118 |
120 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. | 119 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. |
121 | 120 |
122 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: | 121 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: |
123 Run JavaScript in the specified browser. | 122 Run JavaScript in the specified browser. |
124 | 123 |
125 none: No runtime, compile only (for example, used for dart2analyzer static | 124 none: No runtime, compile only (for example, used for dart2analyzer static |
126 analysis tests).''', | 125 analysis tests).''', |
127 ['-r', '--runtime'], | 126 ['-r', '--runtime'], |
128 [ | 127 [ |
129 'vm', | 128 'vm', |
130 'dart_precompiled', | 129 'dart_precompiled', |
131 'dart_app', | 130 'dart_app', // TODO(rmacnak): Remove after updating bots. |
132 'd8', | 131 'd8', |
133 'jsshell', | 132 'jsshell', |
134 'drt', | 133 'drt', |
135 'dartium', | 134 'dartium', |
136 'ff', | 135 'ff', |
137 'firefox', | 136 'firefox', |
138 'chrome', | 137 'chrome', |
139 'safari', | 138 'safari', |
140 'ie9', | 139 'ie9', |
141 'ie10', | 140 'ie10', |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 'ie10', | 688 'ie10', |
690 'ie11', | 689 'ie11', |
691 'opera', | 690 'opera', |
692 'chromeOnAndroid', | 691 'chromeOnAndroid', |
693 'safarimobilesim' | 692 'safarimobilesim' |
694 ]; | 693 ]; |
695 break; | 694 break; |
696 case 'dart2analyzer': | 695 case 'dart2analyzer': |
697 validRuntimes = const ['none']; | 696 validRuntimes = const ['none']; |
698 break; | 697 break; |
699 case 'dart2app': | 698 case 'app_jit': |
700 case 'dart2appjit': | |
701 validRuntimes = const ['dart_app']; | |
702 break; | |
703 case 'precompiler': | |
704 validRuntimes = const ['dart_precompiled']; | |
705 break; | |
706 case 'dartk': | 699 case 'dartk': |
707 validRuntimes = const ['vm']; | 700 validRuntimes = const ['vm']; |
708 break; | 701 break; |
| 702 case 'precompiler': |
709 case 'dartkp': | 703 case 'dartkp': |
710 validRuntimes = const ['dart_precompiled']; | 704 validRuntimes = const ['dart_precompiled']; |
711 break; | 705 break; |
712 case 'none': | 706 case 'none': |
713 validRuntimes = const [ | 707 validRuntimes = const [ |
714 'vm', | 708 'vm', |
715 'drt', | 709 'drt', |
716 'dartium', | 710 'dartium', |
717 'ContentShellOnAndroid', | 711 'ContentShellOnAndroid', |
718 'DartiumOnAndroid' | 712 'DartiumOnAndroid' |
(...skipping 24 matching lines...) Expand all Loading... |
743 } | 737 } |
744 | 738 |
745 return isValid; | 739 return isValid; |
746 } | 740 } |
747 | 741 |
748 /** | 742 /** |
749 * Recursively expand a configuration with multiple values per key | 743 * Recursively expand a configuration with multiple values per key |
750 * into a list of configurations with exactly one value per key. | 744 * into a list of configurations with exactly one value per key. |
751 */ | 745 */ |
752 List<Map> _expandConfigurations(Map configuration) { | 746 List<Map> _expandConfigurations(Map configuration) { |
| 747 // TODO(rmacnak): Remove after updating bots. |
| 748 if (configuration['runtime'] == 'dart_app') { |
| 749 configuration['runtime'] = 'vm'; |
| 750 } |
| 751 if (configuration['compiler'] == 'dart2app' || |
| 752 configuration['compiler'] == 'dart2appjit') { |
| 753 configuration['compiler'] = 'app_jit'; |
| 754 } |
| 755 |
753 // Expand the pseudo-values such as 'all'. | 756 // Expand the pseudo-values such as 'all'. |
754 if (configuration['arch'] == 'all') { | 757 if (configuration['arch'] == 'all') { |
755 configuration['arch'] = 'ia32,x64,simarm,simarm64,simmips,simdbc64'; | 758 configuration['arch'] = 'ia32,x64,simarm,simarm64,simmips,simdbc64'; |
756 } | 759 } |
757 if (configuration['mode'] == 'all') { | 760 if (configuration['mode'] == 'all') { |
758 configuration['mode'] = 'debug,release,product'; | 761 configuration['mode'] = 'debug,release,product'; |
759 } | 762 } |
760 | 763 |
761 if (configuration['report_in_json']) { | 764 if (configuration['report_in_json']) { |
762 configuration['list'] = true; | 765 configuration['list'] = true; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 if (option.keys.contains(name)) { | 996 if (option.keys.contains(name)) { |
994 return option; | 997 return option; |
995 } | 998 } |
996 } | 999 } |
997 print('Unknown test option $name'); | 1000 print('Unknown test option $name'); |
998 exit(1); | 1001 exit(1); |
999 } | 1002 } |
1000 | 1003 |
1001 List<_TestOptionSpecification> _options; | 1004 List<_TestOptionSpecification> _options; |
1002 } | 1005 } |
OLD | NEW |