| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 void enqueueBrowserTest(String filename, | 411 void enqueueBrowserTest(String filename, |
| 412 String testName, | 412 String testName, |
| 413 Map optionsFromFile, | 413 Map optionsFromFile, |
| 414 Set<String> expectations, | 414 Set<String> expectations, |
| 415 bool isNegative) { | 415 bool isNegative) { |
| 416 if (optionsFromFile['isMultitest']) return; | 416 if (optionsFromFile['isMultitest']) return; |
| 417 bool isWebTest = optionsFromFile['containsDomImport']; | 417 bool isWebTest = optionsFromFile['containsDomImport']; |
| 418 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition']; | 418 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition']; |
| 419 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) { | 419 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) { |
| 420 print('Warning for $filename: Browser tests require #library ' + | 420 print('Warning for $filename: Browser tests require #library ' + |
| 421 'in any file that uses #import or #source'); | 421 'in any file that uses #import, #source, or #resource'); |
| 422 } | 422 } |
| 423 | 423 |
| 424 final String component = configuration['component']; | 424 final String component = configuration['component']; |
| 425 final String testPath = | 425 final String testPath = |
| 426 new File(filename).fullPathSync().replaceAll('\\', '/'); | 426 new File(filename).fullPathSync().replaceAll('\\', '/'); |
| 427 | 427 |
| 428 for (var vmOptions in optionsFromFile['vmOptions']) { | 428 for (var vmOptions in optionsFromFile['vmOptions']) { |
| 429 // Create a unique temporary directory for each set of vmOptions. | 429 // Create a unique temporary directory for each set of vmOptions. |
| 430 // TODO(dart:429): Replace separate replaceAlls with a RegExp when | 430 // TODO(dart:429): Replace separate replaceAlls with a RegExp when |
| 431 // replaceAll(RegExp, String) is implemented. | 431 // replaceAll(RegExp, String) is implemented. |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 RegExp dartOptionsRegExp = const RegExp(@"// DartOptions=(.*)"); | 736 RegExp dartOptionsRegExp = const RegExp(@"// DartOptions=(.*)"); |
| 737 RegExp multiTestRegExp = const RegExp(@"/// [0-9][0-9]:(.*)"); | 737 RegExp multiTestRegExp = const RegExp(@"/// [0-9][0-9]:(.*)"); |
| 738 RegExp leadingHashRegExp = const RegExp(@"^#", multiLine: true); | 738 RegExp leadingHashRegExp = const RegExp(@"^#", multiLine: true); |
| 739 RegExp isolateStubsRegExp = const RegExp(@"// IsolateStubs=(.*)"); | 739 RegExp isolateStubsRegExp = const RegExp(@"// IsolateStubs=(.*)"); |
| 740 RegExp domImportRegExp = | 740 RegExp domImportRegExp = |
| 741 const RegExp(@"^#import.*(dart:(dom|html)|html\.dart).*\)", | 741 const RegExp(@"^#import.*(dart:(dom|html)|html\.dart).*\)", |
| 742 multiLine: true); | 742 multiLine: true); |
| 743 RegExp libraryDefinitionRegExp = | 743 RegExp libraryDefinitionRegExp = |
| 744 const RegExp(@"^#library\(", multiLine: true); | 744 const RegExp(@"^#library\(", multiLine: true); |
| 745 RegExp sourceOrImportRegExp = | 745 RegExp sourceOrImportRegExp = |
| 746 const RegExp(@"^#(source|import)\(", multiLine: true); | 746 const RegExp(@"^#(source|import|resource)\(", multiLine: true); |
| 747 | 747 |
| 748 // Read the entire file into a byte buffer and transform it to a | 748 // Read the entire file into a byte buffer and transform it to a |
| 749 // String. This will treat the file as ascii but the only parts | 749 // String. This will treat the file as ascii but the only parts |
| 750 // we are interested in will be ascii in any case. | 750 // we are interested in will be ascii in any case. |
| 751 RandomAccessFile file = new File(filename).openSync(); | 751 RandomAccessFile file = new File(filename).openSync(); |
| 752 List chars = new List(file.lengthSync()); | 752 List chars = new List(file.lengthSync()); |
| 753 var offset = 0; | 753 var offset = 0; |
| 754 while (offset != chars.length) { | 754 while (offset != chars.length) { |
| 755 offset += file.readListSync(chars, offset, chars.length - offset); | 755 offset += file.readListSync(chars, offset, chars.length - offset); |
| 756 } | 756 } |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 * $noCrash tests are expected to be flaky but not crash | 1125 * $noCrash tests are expected to be flaky but not crash |
| 1126 * $pass tests are expected to pass | 1126 * $pass tests are expected to pass |
| 1127 * $failOk tests are expected to fail that we won't fix | 1127 * $failOk tests are expected to fail that we won't fix |
| 1128 * $fail tests are expected to fail that we should fix | 1128 * $fail tests are expected to fail that we should fix |
| 1129 * $crash tests are expected to crash that we should fix | 1129 * $crash tests are expected to crash that we should fix |
| 1130 * $timeout tests are allowed to timeout | 1130 * $timeout tests are allowed to timeout |
| 1131 """; | 1131 """; |
| 1132 print(report); | 1132 print(report); |
| 1133 } | 1133 } |
| 1134 } | 1134 } |
| OLD | NEW |