| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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("standalone_test_config"); | 5 #library("standalone_test_config"); |
| 6 | 6 |
| 7 #import("../../tools/testing/dart/test_runner.dart"); | 7 #import("../../tools/testing/dart/test_runner.dart"); |
| 8 #import("../../tools/testing/dart/status_file_parser.dart"); | 8 #import("../../tools/testing/dart/status_file_parser.dart"); |
| 9 | 9 |
| 10 class StandaloneTestSuite { | 10 class StandaloneTestSuite { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 throw s; | 39 throw s; |
| 40 }; | 40 }; |
| 41 dir.fileHandler = processFile; | 41 dir.fileHandler = processFile; |
| 42 dir.doneHandler = doDone; | 42 dir.doneHandler = doDone; |
| 43 dir.list(false); | 43 dir.list(false); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void processFile(String filename) { | 46 void processFile(String filename) { |
| 47 if (!filename.endsWith("Test.dart")) return; | 47 if (!filename.endsWith("Test.dart")) return; |
| 48 | 48 |
| 49 // If patterns are given only list the files that match one of the |
| 50 // patterns. |
| 51 var patterns = configuration['patterns']; |
| 52 if (!patterns.isEmpty() && |
| 53 !patterns.some((re) => re.hasMatch(filename))) { |
| 54 return; |
| 55 } |
| 56 |
| 49 int start = filename.lastIndexOf(pathSeparator); | 57 int start = filename.lastIndexOf(pathSeparator); |
| 50 String testName = filename.substring(start + 1, filename.length - 5); | 58 String testName = filename.substring(start + 1, filename.length - 5); |
| 51 Set<String> expectations = testExpectationsMap.expectations(testName); | 59 Set<String> expectations = testExpectationsMap.expectations(testName); |
| 52 | 60 |
| 53 // TODO(whesse): Skip files with internal directives, and multipart files, | 61 // TODO(whesse): Skip files with internal directives, and multipart files, |
| 54 // until they are handled correctly. | 62 // until they are handled correctly. |
| 55 if (expectations.contains(SKIP)) return; | 63 if (expectations.contains(SKIP)) return; |
| 56 | 64 |
| 57 List args = ["--ignore-unrecognized-flags"]; | 65 List args = ["--ignore-unrecognized-flags"]; |
| 58 if (configuration["checked"]) { | 66 if (configuration["checked"]) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (match != null) { | 106 if (match != null) { |
| 99 result.add(match[1].split(' ').filter((e) => e != '')); | 107 result.add(match[1].split(' ').filter((e) => e != '')); |
| 100 } | 108 } |
| 101 } | 109 } |
| 102 return result; | 110 return result; |
| 103 } | 111 } |
| 104 | 112 |
| 105 void completeHandler(TestCase testCase) { | 113 void completeHandler(TestCase testCase) { |
| 106 } | 114 } |
| 107 } | 115 } |
| OLD | NEW |