| 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"; |
| 11 import "compiler_configuration.dart" show CompilerConfiguration; | 11 import "compiler_configuration.dart" show CompilerConfiguration; |
| 12 import "runtime_configuration.dart" show RuntimeConfiguration; | 12 import "runtime_configuration.dart" show RuntimeConfiguration; |
| 13 | 13 |
| 14 const List<String> defaultTestSelectors = const [ | 14 const List<String> defaultTestSelectors = const [ |
| 15 'samples', | 15 'samples', |
| 16 'standalone', | 16 'standalone', |
| 17 'corelib', | 17 'corelib', |
| 18 'co19', | 18 'co19', |
| 19 'language', | 19 'language', |
| 20 'isolate', | 20 'isolate', |
| 21 'vm', | 21 'vm', |
| 22 'html', | 22 'html', |
| 23 'benchmark_smoke', | 23 'benchmark_smoke', |
| 24 'utils', | 24 'utils', |
| 25 'lib', | 25 'lib', |
| 26 'pkg', | 26 'pkg', |
| 27 'analyze_library', | 27 'analyze_library', |
| 28 'service', | 28 'service', |
| 29 'kernel', |
| 29 'observatory_ui' | 30 'observatory_ui' |
| 30 ]; | 31 ]; |
| 31 | 32 |
| 32 /** | 33 /** |
| 33 * Specification of a single test option. | 34 * Specification of a single test option. |
| 34 * | 35 * |
| 35 * The name of the specification is used as the key for the option in | 36 * The name of the specification is used as the key for the option in |
| 36 * the Map returned from the [TestOptionParser] parse method. | 37 * the Map returned from the [TestOptionParser] parse method. |
| 37 */ | 38 */ |
| 38 class _TestOptionSpecification { | 39 class _TestOptionSpecification { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 68 dart2js: Compile dart code to JavaScript by running dart2js. | 69 dart2js: Compile dart code to JavaScript by running dart2js. |
| 69 (only valid with the following runtimes: d8, drt, chrome, | 70 (only valid with the following runtimes: d8, drt, chrome, |
| 70 safari, ie9, ie10, ie11, firefox, opera, chromeOnAndroid, | 71 safari, ie9, ie10, ie11, firefox, opera, chromeOnAndroid, |
| 71 none (compile only)), | 72 none (compile only)), |
| 72 | 73 |
| 73 dart2analyzer: Perform static analysis on Dart code by running the analyzer | 74 dart2analyzer: Perform static analysis on Dart code by running the analyzer |
| 74 (only valid with the following runtimes: none) | 75 (only valid with the following runtimes: none) |
| 75 | 76 |
| 76 dart2app: | 77 dart2app: |
| 77 dart2appjit: Compile the Dart code into an app snapshot before running test | 78 dart2appjit: Compile the Dart code into an app snapshot before running test |
| 78 (only valid with dart_app runtime)''', | 79 (only valid with dart_app runtime) |
| 80 |
| 81 dartk: Compile the Dart source into Kernel before running test. |
| 82 |
| 83 dartkp: Compiler the Dart source into Kernel and then Kernel into AOT |
| 84 snapshot before running the test.''', |
| 79 ['-c', '--compiler'], | 85 ['-c', '--compiler'], |
| 80 ['none', 'precompiler', 'dart2js', 'dart2analyzer', 'dart2app', 'dart2
appjit'], | 86 ['none', 'precompiler', 'dart2js', 'dart2analyzer', 'dart2app', |
| 87 'dart2appjit', 'dartk', 'dartkp'], |
| 81 'none'), | 88 'none'), |
| 82 // TODO(antonm): fix the option drt. | 89 // TODO(antonm): fix the option drt. |
| 83 new _TestOptionSpecification( | 90 new _TestOptionSpecification( |
| 84 'runtime', | 91 'runtime', |
| 85 '''Where the tests should be run. | 92 '''Where the tests should be run. |
| 86 vm: Run Dart code on the standalone dart vm. | 93 vm: Run Dart code on the standalone dart vm. |
| 87 | 94 |
| 88 dart_precompiled: Run a precompiled snapshot on a variant of the standalone | 95 dart_precompiled: Run a precompiled snapshot on a variant of the standalone |
| 89 dart vm lacking a JIT. | 96 dart vm lacking a JIT. |
| 90 | 97 |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 case 'dart2analyzer': | 677 case 'dart2analyzer': |
| 671 validRuntimes = const ['none']; | 678 validRuntimes = const ['none']; |
| 672 break; | 679 break; |
| 673 case 'dart2app': | 680 case 'dart2app': |
| 674 case 'dart2appjit': | 681 case 'dart2appjit': |
| 675 validRuntimes = const ['dart_app']; | 682 validRuntimes = const ['dart_app']; |
| 676 break; | 683 break; |
| 677 case 'precompiler': | 684 case 'precompiler': |
| 678 validRuntimes = const ['dart_precompiled']; | 685 validRuntimes = const ['dart_precompiled']; |
| 679 break; | 686 break; |
| 687 case 'dartk': |
| 688 validRuntimes = const ['vm']; |
| 689 break; |
| 690 case 'dartkp': |
| 691 validRuntimes = const ['dart_precompiled']; |
| 692 break; |
| 680 case 'none': | 693 case 'none': |
| 681 validRuntimes = const [ | 694 validRuntimes = const [ |
| 682 'vm', | 695 'vm', |
| 683 'drt', | 696 'drt', |
| 684 'dartium', | 697 'dartium', |
| 685 'ContentShellOnAndroid', | 698 'ContentShellOnAndroid', |
| 686 'DartiumOnAndroid' | 699 'DartiumOnAndroid' |
| 687 ]; | 700 ]; |
| 688 break; | 701 break; |
| 689 } | 702 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 // Return the expansions of both configurations. Neither will reach | 844 // Return the expansions of both configurations. Neither will reach |
| 832 // this line in the recursive call to _expandConfigurations. | 845 // this line in the recursive call to _expandConfigurations. |
| 833 return _expandConfigurations(configuration) | 846 return _expandConfigurations(configuration) |
| 834 ..addAll(_expandConfigurations(observatoryConfiguration)); | 847 ..addAll(_expandConfigurations(observatoryConfiguration)); |
| 835 } | 848 } |
| 836 } | 849 } |
| 837 // Set the default package spec explicitly. | 850 // Set the default package spec explicitly. |
| 838 if (configuration['package_root'] == null && | 851 if (configuration['package_root'] == null && |
| 839 configuration['packages'] == null) { | 852 configuration['packages'] == null) { |
| 840 configuration['packages'] = | 853 configuration['packages'] = |
| 841 TestUtils.dartDirUri.resolve('.packages').toFilePath(); | 854 TestUtils.dartDirUri.resolve('.packages').toFilePath(); |
| 842 } | 855 } |
| 843 | 856 |
| 844 // Expand the architectures. | 857 // Expand the architectures. |
| 845 if (configuration['arch'].contains(',')) { | 858 if (configuration['arch'].contains(',')) { |
| 846 return _expandHelper('arch', configuration); | 859 return _expandHelper('arch', configuration); |
| 847 } | 860 } |
| 848 | 861 |
| 849 // Expand modes. | 862 // Expand modes. |
| 850 if (configuration['mode'].contains(',')) { | 863 if (configuration['mode'].contains(',')) { |
| 851 return _expandHelper('mode', configuration); | 864 return _expandHelper('mode', configuration); |
| 852 } | 865 } |
| 853 | 866 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 if (option.keys.contains(name)) { | 971 if (option.keys.contains(name)) { |
| 959 return option; | 972 return option; |
| 960 } | 973 } |
| 961 } | 974 } |
| 962 print('Unknown test option $name'); | 975 print('Unknown test option $name'); |
| 963 exit(1); | 976 exit(1); |
| 964 } | 977 } |
| 965 | 978 |
| 966 List<_TestOptionSpecification> _options; | 979 List<_TestOptionSpecification> _options; |
| 967 } | 980 } |
| OLD | NEW |