| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 Strings.join(testsAsLines[key], line_separator) + line_separator; | 112 Strings.join(testsAsLines[key], line_separator) + line_separator; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 | 116 |
| 117 void DoMultitest(String filename, | 117 void DoMultitest(String filename, |
| 118 String outputDir, | 118 String outputDir, |
| 119 String testDir, | 119 String testDir, |
| 120 Function doTest(String filename, | 120 Function doTest(String filename, |
| 121 bool isNegative, | 121 bool isNegative, |
| 122 [bool isNegativeIfChecked]), | 122 [bool isNegativeIfChecked, |
| 123 bool hasFatalTypeErrors]), |
| 123 Function multitestDone) { | 124 Function multitestDone) { |
| 124 // Each new test is a single String value in the Map tests. | 125 // Each new test is a single String value in the Map tests. |
| 125 Map<String, String> tests = new Map<String, String>(); | 126 Map<String, String> tests = new Map<String, String>(); |
| 126 Map<String, String> outcomes = new Map<String, String>(); | 127 Map<String, String> outcomes = new Map<String, String>(); |
| 127 ExtractTestsFromMultitest(filename, tests, outcomes); | 128 ExtractTestsFromMultitest(filename, tests, outcomes); |
| 128 | 129 |
| 129 String directory = CreateMultitestDirectory(outputDir, testDir); | 130 String directory = CreateMultitestDirectory(outputDir, testDir); |
| 130 String pathSeparator = new Platform().pathSeparator(); | 131 String pathSeparator = new Platform().pathSeparator(); |
| 131 int start = filename.lastIndexOf(pathSeparator) + 1; | 132 int start = filename.lastIndexOf(pathSeparator) + 1; |
| 132 int end = filename.indexOf('.dart', start); | 133 int end = filename.indexOf('.dart', start); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 163 var split = testDir.split('/'); | 164 var split = testDir.split('/'); |
| 164 var lastComponent = split.removeLast(); | 165 var lastComponent = split.removeLast(); |
| 165 Expect.isTrue(lastComponent == 'src'); | 166 Expect.isTrue(lastComponent == 'src'); |
| 166 String path = '${parentDir.path}/${split.last()}'; | 167 String path = '${parentDir.path}/${split.last()}'; |
| 167 Directory dir = new Directory(path); | 168 Directory dir = new Directory(path); |
| 168 if (!dir.existsSync()) { | 169 if (!dir.existsSync()) { |
| 169 dir.createSync(); | 170 dir.createSync(); |
| 170 } | 171 } |
| 171 return path; | 172 return path; |
| 172 } | 173 } |
| OLD | NEW |