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 library multitest; | 5 library multitest; |
6 | 6 |
7 import "dart:async"; | 7 import "dart:async"; |
8 import "dart:io"; | 8 import "dart:io"; |
9 import "test_suite.dart"; | 9 import "test_suite.dart"; |
10 import "utils.dart"; | 10 import "utils.dart"; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 "Expected one of: ${validMultitestOutcomes.toString()}"); | 115 "Expected one of: ${validMultitestOutcomes.toString()}"); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 // Add the template, with no multitest lines, as a test with key 'none'. | 119 // Add the template, with no multitest lines, as a test with key 'none'. |
120 testsAsLines['none'] = testTemplate; | 120 testsAsLines['none'] = testTemplate; |
121 outcomes['none'] = new Set<String>(); | 121 outcomes['none'] = new Set<String>(); |
122 | 122 |
123 // Copy all the tests into the output map tests, as multiline strings. | 123 // Copy all the tests into the output map tests, as multiline strings. |
124 for (String key in testsAsLines.keys) { | 124 for (String key in testsAsLines.keys) { |
125 tests[key] = | 125 tests[key] = testsAsLines[key].join(line_separator).concat(line_separator); |
126 Strings.join(testsAsLines[key], line_separator).concat(line_separator); | |
127 } | 126 } |
128 } | 127 } |
129 | 128 |
130 // Represents a mutlitest annotation in the special /// comment. | 129 // Represents a mutlitest annotation in the special /// comment. |
131 class _Annotation { | 130 class _Annotation { |
132 String key; | 131 String key; |
133 String rest; | 132 String rest; |
134 List<String> outcomesList; | 133 List<String> outcomesList; |
135 _Annotation() {} | 134 _Annotation() {} |
136 factory _Annotation.from(String line) { | 135 factory _Annotation.from(String line) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // TestSuite.forDirectory. | 255 // TestSuite.forDirectory. |
257 split.removeLast(); | 256 split.removeLast(); |
258 } | 257 } |
259 String path = '${generatedTestDir.path}/${split.last}'; | 258 String path = '${generatedTestDir.path}/${split.last}'; |
260 Directory dir = new Directory(path); | 259 Directory dir = new Directory(path); |
261 if (!dir.existsSync()) { | 260 if (!dir.existsSync()) { |
262 dir.createSync(); | 261 dir.createSync(); |
263 } | 262 } |
264 return new Path(new File(path).fullPathSync()); | 263 return new Path(new File(path).fullPathSync()); |
265 } | 264 } |
OLD | NEW |