| 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 #import("dart:io"); | 7 #import("dart:io"); |
| 8 | 8 |
| 9 // Multitests are Dart test scripts containing lines of the form | 9 // Multitests are Dart test scripts containing lines of the form |
| 10 // " [some dart code] /// [key]: [error type]" | 10 // " [some dart code] /// [key]: [error type]" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 // Copy all the tests into the output map tests, as multiline strings. | 111 // Copy all the tests into the output map tests, as multiline strings. |
| 112 for (String key in testsAsLines.getKeys()) { | 112 for (String key in testsAsLines.getKeys()) { |
| 113 tests[key] = | 113 tests[key] = |
| 114 Strings.join(testsAsLines[key], line_separator) + line_separator; | 114 Strings.join(testsAsLines[key], line_separator) + line_separator; |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 | 118 |
| 119 void DoMultitest(String filename, | 119 void DoMultitest(String filename, |
| 120 String component, | |
| 121 String outputDir, | 120 String outputDir, |
| 122 String testDir, | 121 String testDir, |
| 123 Function doTest(String filename, | 122 Function doTest(String filename, |
| 124 bool isNegative, | 123 bool isNegative, |
| 125 [bool isNegativeIfChecked, | 124 [bool isNegativeIfChecked, |
| 126 bool hasFatalTypeErrors, | 125 bool hasFatalTypeErrors, |
| 127 bool hasRuntimeErrors]), | 126 bool hasRuntimeErrors]), |
| 128 Function multitestDone) { | 127 Function multitestDone) { |
| 129 // Each new test is a single String value in the Map tests. | 128 // Each new test is a single String value in the Map tests. |
| 130 Map<String, String> tests = new Map<String, String>(); | 129 Map<String, String> tests = new Map<String, String>(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 var split = testDir.split('/'); | 172 var split = testDir.split('/'); |
| 174 var lastComponent = split.removeLast(); | 173 var lastComponent = split.removeLast(); |
| 175 Expect.isTrue(lastComponent == 'src'); | 174 Expect.isTrue(lastComponent == 'src'); |
| 176 String path = '${generatedTestDir.path}/${split.last()}'; | 175 String path = '${generatedTestDir.path}/${split.last()}'; |
| 177 Directory dir = new Directory(path); | 176 Directory dir = new Directory(path); |
| 178 if (!dir.existsSync()) { | 177 if (!dir.existsSync()) { |
| 179 dir.createSync(); | 178 dir.createSync(); |
| 180 } | 179 } |
| 181 return path; | 180 return path; |
| 182 } | 181 } |
| OLD | NEW |