| Index: tests/corelib/test_config.dart
|
| diff --git a/tests/corelib/test_config.dart b/tests/corelib/test_config.dart
|
| index ace1a9798c1e8b737559098b169d420e19e6c776..5105fb4b696a7c473773158b817109fc70458f2f 100644
|
| --- a/tests/corelib/test_config.dart
|
| +++ b/tests/corelib/test_config.dart
|
| @@ -97,29 +97,41 @@ class CorelibTestSuite {
|
| Map testOptions(String filename) {
|
| RegExp testOptionsRegExp = const RegExp(@"// VMOptions=(.*)");
|
| RegExp dartOptionsRegExp = const RegExp(@"// DartOptions=(.*)");
|
| +
|
| + // Read the entire file into a byte buffer and transform it to a
|
| + // String. This will treat the file as ascii but the only parts
|
| + // we are interested in will be ascii in any case.
|
| File file = new File(filename);
|
| - FileInputStream fileStream = file.openInputStream();
|
| - StringInputStream lines = new StringInputStream(fileStream);
|
| + file.openSync();
|
| + List chars = new List(file.lengthSync());
|
| + var offset = 0;
|
| + while (offset != chars.length) {
|
| + offset += file.readListSync(chars, offset, chars.length - offset);
|
| + }
|
| + file.closeSync();
|
| + String contents = new String.fromCharCodes(chars);
|
| + chars = null;
|
|
|
| + // Find the options in the file.
|
| List<List> result = new List<List>();
|
| List<String> dartOptions;
|
| - String line;
|
| - while ((line = lines.readLine()) != null) {
|
| - Match match = testOptionsRegExp.firstMatch(line);
|
| - if (match != null) {
|
| - result.add(match[1].split(' ').filter((e) => e != ''));
|
| - }
|
| + bool isNegative = false;
|
|
|
| - match = dartOptionsRegExp.firstMatch(line);
|
| - if (match != null) {
|
| - if (dartOptions != null) {
|
| - throw new Exception(
|
| - 'More than one "// DartOptions=" line in test $filename');
|
| - }
|
| - dartOptions = match[1].split(' ').filter((e) => e != '');
|
| + Iterable<Match> matches = testOptionsRegExp.allMatches(contents);
|
| + for (var match in matches) {
|
| + result.add(match[1].split(' ').filter((e) => e != ''));
|
| + }
|
| +
|
| + matches = dartOptionsRegExp.allMatches(contents);
|
| + for (var match in matches) {
|
| + if (dartOptions != null) {
|
| + throw new Exception(
|
| + 'More than one "// DartOptions=" line in test $filename');
|
| }
|
| + dartOptions = match[1].split(' ').filter((e) => e != '');
|
| }
|
| - return {"vmOptions": result, "dartOptions": dartOptions};
|
| +
|
| + return { "vmOptions": result, "dartOptions": dartOptions };
|
| }
|
|
|
| void completeHandler(TestCase testCase) {
|
|
|