| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 |
| 70 dart2snapshot: Compile the Dart code into a snapshot before running the test |
| 71 (only valid with the following runtimes: dart_snapshotted)''', |
| 69 ['-c', '--compiler'], | 72 ['-c', '--compiler'], |
| 70 ['none', 'precompiler', 'dart2js', 'dart2analyzer'], | 73 ['none', 'precompiler', 'dart2js', 'dart2analyzer', |
| 74 'dart2snapshot'], |
| 71 'none'), | 75 'none'), |
| 72 // TODO(antonm): fix the option drt. | 76 // TODO(antonm): fix the option drt. |
| 73 new _TestOptionSpecification( | 77 new _TestOptionSpecification( |
| 74 'runtime', | 78 'runtime', |
| 75 '''Where the tests should be run. | 79 '''Where the tests should be run. |
| 76 vm: Run Dart code on the standalone dart vm. | 80 vm: Run Dart code on the standalone dart vm. |
| 77 | 81 |
| 78 dart_precompiled: Run a precompiled snapshot on a variant of the standalone | 82 dart_precompiled: Run a precompiled snapshot on a variant of the standalone |
| 79 dart vm lacking a JIT. | 83 dart vm lacking a JIT. |
| 80 | 84 |
| 85 dart_snapshotted: Run a full snapshot. |
| 86 |
| 81 d8: Run JavaScript from the command line using v8. | 87 d8: Run JavaScript from the command line using v8. |
| 82 | 88 |
| 83 jsshell: Run JavaScript from the command line using firefox js-shell. | 89 jsshell: Run JavaScript from the command line using firefox js-shell. |
| 84 | 90 |
| 85 drt: Run Dart or JavaScript in the headless version of Chrome, | 91 drt: Run Dart or JavaScript in the headless version of Chrome, |
| 86 Content shell. | 92 Content shell. |
| 87 | 93 |
| 88 dartium: Run Dart or JavaScript in Dartium. | 94 dartium: Run Dart or JavaScript in Dartium. |
| 89 | 95 |
| 90 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell | 96 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell |
| 91 on Android. | 97 on Android. |
| 92 | 98 |
| 93 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. | 99 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. |
| 94 | 100 |
| 95 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: | 101 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: |
| 96 Run JavaScript in the specified browser. | 102 Run JavaScript in the specified browser. |
| 97 | 103 |
| 98 none: No runtime, compile only (for example, used for dart2analyzer static | 104 none: No runtime, compile only (for example, used for dart2analyzer static |
| 99 analysis tests).''', | 105 analysis tests).''', |
| 100 ['-r', '--runtime'], | 106 ['-r', '--runtime'], |
| 101 ['vm', 'dart_precompiled', 'd8', 'jsshell', 'drt', 'dartium', | 107 ['vm', 'dart_precompiled', 'dart_snapshotted', |
| 108 'd8', 'jsshell', 'drt', 'dartium', |
| 102 'ff', 'firefox', | 109 'ff', 'firefox', |
| 103 'chrome', 'safari', 'ie9', 'ie10', 'ie11', 'opera', | 110 'chrome', 'safari', 'ie9', 'ie10', 'ie11', 'opera', |
| 104 'chromeOnAndroid', 'safarimobilesim', | 111 'chromeOnAndroid', 'safarimobilesim', |
| 105 'ContentShellOnAndroid', 'DartiumOnAndroid', 'none'], | 112 'ContentShellOnAndroid', 'DartiumOnAndroid', 'none'], |
| 106 'vm'), | 113 'vm'), |
| 107 new _TestOptionSpecification( | 114 new _TestOptionSpecification( |
| 108 'arch', | 115 'arch', |
| 109 'The architecture to run tests for', | 116 'The architecture to run tests for', |
| 110 ['-a', '--arch'], | 117 ['-a', '--arch'], |
| 111 ['all', 'ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips', | 118 ['all', 'ia32', 'x64', 'arm', 'armv6', 'armv5te', 'arm64', 'mips', |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 // runs test.py -c dart2js -r drt,none the dart2js_none and | 648 // runs test.py -c dart2js -r drt,none the dart2js_none and |
| 642 // dart2js_drt will be duplicating work. If later we don't need 'none' | 649 // dart2js_drt will be duplicating work. If later we don't need 'none' |
| 643 // with dart2js, we should remove it from here. | 650 // with dart2js, we should remove it from here. |
| 644 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', | 651 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', |
| 645 'ff', 'chrome', 'safari', 'ie9', 'ie10', 'ie11', | 652 'ff', 'chrome', 'safari', 'ie9', 'ie10', 'ie11', |
| 646 'opera', 'chromeOnAndroid', 'safarimobilesim']; | 653 'opera', 'chromeOnAndroid', 'safarimobilesim']; |
| 647 break; | 654 break; |
| 648 case 'dart2analyzer': | 655 case 'dart2analyzer': |
| 649 validRuntimes = const ['none']; | 656 validRuntimes = const ['none']; |
| 650 break; | 657 break; |
| 658 case 'dart2snapshot': |
| 659 validRuntimes = const ['dart_snapshotted']; |
| 660 break; |
| 651 case 'precompiler': | 661 case 'precompiler': |
| 652 validRuntimes = const ['dart_precompiled']; | 662 validRuntimes = const ['dart_precompiled']; |
| 653 break; | 663 break; |
| 654 case 'none': | 664 case 'none': |
| 655 validRuntimes = const ['vm', 'drt', 'dartium', | 665 validRuntimes = const ['vm', 'drt', 'dartium', |
| 656 'ContentShellOnAndroid', 'DartiumOnAndroid']; | 666 'ContentShellOnAndroid', 'DartiumOnAndroid']; |
| 657 break; | 667 break; |
| 658 } | 668 } |
| 659 if (!validRuntimes.contains(config['runtime'])) { | 669 if (!validRuntimes.contains(config['runtime'])) { |
| 660 isValid = false; | 670 isValid = false; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 return option; | 901 return option; |
| 892 } | 902 } |
| 893 } | 903 } |
| 894 print('Unknown test option $name'); | 904 print('Unknown test option $name'); |
| 895 exit(1); | 905 exit(1); |
| 896 } | 906 } |
| 897 | 907 |
| 898 | 908 |
| 899 List<_TestOptionSpecification> _options; | 909 List<_TestOptionSpecification> _options; |
| 900 } | 910 } |
| OLD | NEW |