| 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 "dart:math"; | 8 import "dart:math"; |
| 9 import "drt_updater.dart"; | 9 import "drt_updater.dart"; |
| 10 import "test_suite.dart"; | 10 import "test_suite.dart"; |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 594 } |
| 595 Map<String, RegExp> selectorMap = new Map<String, RegExp>(); | 595 Map<String, RegExp> selectorMap = new Map<String, RegExp>(); |
| 596 for (var i = 0; i < selectors.length; i++) { | 596 for (var i = 0; i < selectors.length; i++) { |
| 597 var pattern = selectors[i]; | 597 var pattern = selectors[i]; |
| 598 var suite = pattern; | 598 var suite = pattern; |
| 599 var slashLocation = pattern.indexOf('/'); | 599 var slashLocation = pattern.indexOf('/'); |
| 600 if (slashLocation != -1) { | 600 if (slashLocation != -1) { |
| 601 suite = pattern.substring(0, slashLocation); | 601 suite = pattern.substring(0, slashLocation); |
| 602 pattern = pattern.substring(slashLocation + 1); | 602 pattern = pattern.substring(slashLocation + 1); |
| 603 pattern = pattern.replaceAll('*', '.*'); | 603 pattern = pattern.replaceAll('*', '.*'); |
| 604 pattern = pattern.replaceAll('/', '.*'); | |
| 605 } else { | 604 } else { |
| 606 pattern = ".*"; | 605 pattern = ".?"; |
| 607 } | 606 } |
| 608 if (selectorMap.containsKey(suite)) { | 607 if (selectorMap.containsKey(suite)) { |
| 609 print("Error: '$suite/$pattern'. Only one test selection" | 608 print("Error: '$suite/$pattern'. Only one test selection" |
| 610 " pattern is allowed to start with '$suite/'"); | 609 " pattern is allowed to start with '$suite/'"); |
| 611 exit(1); | 610 exit(1); |
| 612 } | 611 } |
| 613 selectorMap[suite] = new RegExp(pattern); | 612 selectorMap[suite] = new RegExp(pattern); |
| 614 } | 613 } |
| 615 configuration['selectors'] = selectorMap; | 614 configuration['selectors'] = selectorMap; |
| 616 } | 615 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 return option; | 755 return option; |
| 757 } | 756 } |
| 758 } | 757 } |
| 759 print('Unknown test option $name'); | 758 print('Unknown test option $name'); |
| 760 exit(1); | 759 exit(1); |
| 761 } | 760 } |
| 762 | 761 |
| 763 | 762 |
| 764 List<_TestOptionSpecification> _options; | 763 List<_TestOptionSpecification> _options; |
| 765 } | 764 } |
| OLD | NEW |