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 "compiler_configuration.dart" show CompilerConfiguration; | 10 import "compiler_configuration.dart" show CompilerConfiguration; |
11 import "runtime_configuration.dart" show RuntimeConfiguration; | 11 import "runtime_configuration.dart" show RuntimeConfiguration; |
12 | 12 |
13 List<String> defaultTestSelectors = | 13 const List<String> defaultTestSelectors = |
ricow1
2014/03/27 06:52:04
why are you removing const here
kevmoo
2014/03/27 17:27:19
I'm not removing const. I'm ADDING it. :-)
| |
14 const ['samples', 'standalone', 'corelib', 'co19', 'language', | 14 const ['samples', 'standalone', 'corelib', 'co19', 'language', |
15 'isolate', 'vm', 'html', 'json', 'benchmark_smoke', | 15 'isolate', 'vm', 'html', 'benchmark_smoke', |
16 'utils', 'lib', 'pkg', 'analyze_library']; | 16 'utils', 'lib', 'pkg', 'analyze_library']; |
17 | 17 |
18 /** | 18 /** |
19 * Specification of a single test option. | 19 * Specification of a single test option. |
20 * | 20 * |
21 * The name of the specification is used as the key for the option in | 21 * The name of the specification is used as the key for the option in |
22 * the Map returned from the [TestOptionParser] parse method. | 22 * the Map returned from the [TestOptionParser] parse method. |
23 */ | 23 */ |
24 class _TestOptionSpecification { | 24 class _TestOptionSpecification { |
25 _TestOptionSpecification(this.name, | 25 _TestOptionSpecification(this.name, |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
668 // Allow suppression that is valid for all ie versions | 668 // Allow suppression that is valid for all ie versions |
669 configuration['ie'] = runtime.startsWith('ie'); | 669 configuration['ie'] = runtime.startsWith('ie'); |
670 | 670 |
671 // Expand the test selectors into a suite name and a simple | 671 // Expand the test selectors into a suite name and a simple |
672 // regular expressions to be used on the full path of a test file | 672 // regular expressions to be used on the full path of a test file |
673 // in that test suite. If no selectors are explicitly given use | 673 // in that test suite. If no selectors are explicitly given use |
674 // the default suite patterns. | 674 // the default suite patterns. |
675 var selectors = configuration['selectors']; | 675 var selectors = configuration['selectors']; |
676 if (selectors is !Map) { | 676 if (selectors is !Map) { |
677 if (selectors == null) { | 677 if (selectors == null) { |
678 selectors = new List.from(defaultTestSelectors); | 678 selectors = defaultTestSelectors; |
679 } | 679 } |
680 Map<String, RegExp> selectorMap = new Map<String, RegExp>(); | 680 Map<String, RegExp> selectorMap = new Map<String, RegExp>(); |
681 for (var i = 0; i < selectors.length; i++) { | 681 for (var i = 0; i < selectors.length; i++) { |
682 var pattern = selectors[i]; | 682 var pattern = selectors[i]; |
683 var suite = pattern; | 683 var suite = pattern; |
684 var slashLocation = pattern.indexOf('/'); | 684 var slashLocation = pattern.indexOf('/'); |
685 if (slashLocation != -1) { | 685 if (slashLocation != -1) { |
686 suite = pattern.substring(0, slashLocation); | 686 suite = pattern.substring(0, slashLocation); |
687 pattern = pattern.substring(slashLocation + 1); | 687 pattern = pattern.substring(slashLocation + 1); |
688 pattern = pattern.replaceAll('*', '.*'); | 688 pattern = pattern.replaceAll('*', '.*'); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
809 return option; | 809 return option; |
810 } | 810 } |
811 } | 811 } |
812 print('Unknown test option $name'); | 812 print('Unknown test option $name'); |
813 exit(1); | 813 exit(1); |
814 } | 814 } |
815 | 815 |
816 | 816 |
817 List<_TestOptionSpecification> _options; | 817 List<_TestOptionSpecification> _options; |
818 } | 818 } |
OLD | NEW |