| 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("multitest"); | 5 #library("multitest"); |
| 6 | 6 |
| 7 // Multitests are Dart test scripts containing lines of the form | 7 // Multitests are Dart test scripts containing lines of the form |
| 8 // " [some dart code] /// [key]: [error type]" | 8 // " [some dart code] /// [key]: [error type]" |
| 9 // | 9 // |
| 10 // For each key in the file, a new test file is made containing all | 10 // For each key in the file, a new test file is made containing all |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 file.noPendingWriteHandler =() { | 173 file.noPendingWriteHandler =() { |
| 174 file.close(); | 174 file.close(); |
| 175 }; | 175 }; |
| 176 file.closeHandler = () { | 176 file.closeHandler = () { |
| 177 var outcome = outcomes[key]; | 177 var outcome = outcomes[key]; |
| 178 bool enableFatalTypeErrors = (supportsFatalTypeErrors && | 178 bool enableFatalTypeErrors = (supportsFatalTypeErrors && |
| 179 outcome.contains('static type error')); | 179 outcome.contains('static type error')); |
| 180 bool isNegative = (outcome.contains('compile-time error') || | 180 bool isNegative = (outcome.contains('compile-time error') || |
| 181 outcome.contains('runtime error') || | 181 outcome.contains('runtime error') || |
| 182 enableFatalTypeErrors); | 182 enableFatalTypeErrors); |
| 183 bool isNegativeIfChecked = outcome.contains('type error'); | 183 bool isNegativeIfChecked = outcome.contains('dynamic type error'); |
| 184 doTest(filename, | 184 doTest(filename, |
| 185 isNegative, | 185 isNegative, |
| 186 isNegativeIfChecked, | 186 isNegativeIfChecked, |
| 187 enableFatalTypeErrors); | 187 enableFatalTypeErrors); |
| 188 WriteMultitestToFileAndQueueIt(tests, | 188 WriteMultitestToFileAndQueueIt(tests, |
| 189 outcomes, | 189 outcomes, |
| 190 supportsFatalTypeErrors, | 190 supportsFatalTypeErrors, |
| 191 currentKey, | 191 currentKey, |
| 192 basePath, | 192 basePath, |
| 193 doTest, | 193 doTest, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 205 var split = testDir.split(new Platform().pathSeparator()); | 205 var split = testDir.split(new Platform().pathSeparator()); |
| 206 var lastComponent = split.removeLast(); | 206 var lastComponent = split.removeLast(); |
| 207 Expect.isTrue(lastComponent == 'src'); | 207 Expect.isTrue(lastComponent == 'src'); |
| 208 String path = parent_dir.path + split.last(); | 208 String path = parent_dir.path + split.last(); |
| 209 Directory dir = new Directory(path); | 209 Directory dir = new Directory(path); |
| 210 if (!dir.existsSync()) { | 210 if (!dir.existsSync()) { |
| 211 dir.createSync(); | 211 dir.createSync(); |
| 212 } | 212 } |
| 213 return path; | 213 return path; |
| 214 } | 214 } |
| OLD | NEW |