| 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, |
| 11 * and creating [TestCase]s for those files that meet the relevant criteria. | 11 * and creating [TestCase]s for those files that meet the relevant criteria. |
| 12 * - Preparing tests, including copying files and frameworks to temporary | 12 * - Preparing tests, including copying files and frameworks to temporary |
| 13 * directories, and computing the command line and arguments to be run. | 13 * directories, and computing the command line and arguments to be run. |
| 14 */ | 14 */ |
| 15 #library("test_suite"); | 15 #library("test_suite"); |
| 16 | 16 |
| 17 #import("dart:io"); | 17 #import("dart:io"); |
| 18 #import("dart:builtin"); |
| 18 #import("dart:isolate"); | 19 #import("dart:isolate"); |
| 19 #import("status_file_parser.dart"); | 20 #import("status_file_parser.dart"); |
| 20 #import("test_runner.dart"); | 21 #import("test_runner.dart"); |
| 21 #import("multitest.dart"); | 22 #import("multitest.dart"); |
| 22 | 23 |
| 23 #source("browser_test.dart"); | 24 #source("browser_test.dart"); |
| 24 | 25 |
| 25 | 26 |
| 26 /** | 27 /** |
| 27 * A TestSuite represents a collection of tests. It creates a [TestCase] | 28 * A TestSuite represents a collection of tests. It creates a [TestCase] |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 const RegExp(@"^#import.*(dart:(dom|html)|html\.dart).*\)", | 776 const RegExp(@"^#import.*(dart:(dom|html)|html\.dart).*\)", |
| 776 multiLine: true); | 777 multiLine: true); |
| 777 RegExp libraryDefinitionRegExp = | 778 RegExp libraryDefinitionRegExp = |
| 778 const RegExp(@"^#library\(", multiLine: true); | 779 const RegExp(@"^#library\(", multiLine: true); |
| 779 RegExp sourceOrImportRegExp = | 780 RegExp sourceOrImportRegExp = |
| 780 const RegExp(@"^#(source|import|resource)\(", multiLine: true); | 781 const RegExp(@"^#(source|import|resource)\(", multiLine: true); |
| 781 | 782 |
| 782 // Read the entire file into a byte buffer and transform it to a | 783 // Read the entire file into a byte buffer and transform it to a |
| 783 // String. This will treat the file as ascii but the only parts | 784 // String. This will treat the file as ascii but the only parts |
| 784 // we are interested in will be ascii in any case. | 785 // we are interested in will be ascii in any case. |
| 785 RandomAccessFile file = new File(filename).openSync(); | 786 RandomAccessFile file = new File(filename).openSync(FileMode.READ); |
| 786 List chars = new List(file.lengthSync()); | 787 List chars = new List(file.lengthSync()); |
| 787 var offset = 0; | 788 var offset = 0; |
| 788 while (offset != chars.length) { | 789 while (offset != chars.length) { |
| 789 offset += file.readListSync(chars, offset, chars.length - offset); | 790 offset += file.readListSync(chars, offset, chars.length - offset); |
| 790 } | 791 } |
| 791 file.closeSync(); | 792 file.closeSync(); |
| 792 String contents = new String.fromCharCodes(chars); | 793 String contents = new String.fromCharCodes(chars); |
| 793 chars = null; | 794 chars = null; |
| 794 | 795 |
| 795 // Find the options in the file. | 796 // Find the options in the file. |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 * $noCrash tests are expected to be flaky but not crash | 1217 * $noCrash tests are expected to be flaky but not crash |
| 1217 * $pass tests are expected to pass | 1218 * $pass tests are expected to pass |
| 1218 * $failOk tests are expected to fail that we won't fix | 1219 * $failOk tests are expected to fail that we won't fix |
| 1219 * $fail tests are expected to fail that we should fix | 1220 * $fail tests are expected to fail that we should fix |
| 1220 * $crash tests are expected to crash that we should fix | 1221 * $crash tests are expected to crash that we should fix |
| 1221 * $timeout tests are allowed to timeout | 1222 * $timeout tests are allowed to timeout |
| 1222 """; | 1223 """; |
| 1223 print(report); | 1224 print(report); |
| 1224 } | 1225 } |
| 1225 } | 1226 } |
| OLD | NEW |