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