OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'util.dart'; | 5 import 'util.dart'; |
6 | 6 |
7 /// The [Uri] of a build step stdio log split into its subparts. | 7 /// The [Uri] of a build step stdio log split into its subparts. |
8 class BuildUri { | 8 class BuildUri { |
9 final String scheme; | 9 final String scheme; |
10 final String host; | 10 final String host; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 final String actual; | 159 final String actual; |
160 final String text; | 160 final String text; |
161 | 161 |
162 factory TestFailure(BuildUri uri, List<String> lines) { | 162 factory TestFailure(BuildUri uri, List<String> lines) { |
163 List<String> parts = split(lines.first, ['FAILED: ', ' ', ' ']); | 163 List<String> parts = split(lines.first, ['FAILED: ', ' ', ' ']); |
164 String configName = parts[1]; | 164 String configName = parts[1]; |
165 String archName = parts[2]; | 165 String archName = parts[2]; |
166 String testName = parts[3]; | 166 String testName = parts[3]; |
167 TestConfiguration id = | 167 TestConfiguration id = |
168 new TestConfiguration(configName, archName, testName); | 168 new TestConfiguration(configName, archName, testName); |
169 String expected = split(lines[1], ['Expected: '])[1]; | 169 String expected = split(lines[1], ['Expected: '])[1].trim(); |
170 String actual = split(lines[2], ['Actual: '])[1]; | 170 String actual = split(lines[2], ['Actual: '])[1].trim(); |
171 return new TestFailure.internal( | 171 return new TestFailure.internal( |
172 uri, id, expected, actual, lines.skip(3).join('\n')); | 172 uri, id, expected, actual, lines.skip(3).join('\n')); |
173 } | 173 } |
174 | 174 |
175 TestFailure.internal( | 175 TestFailure.internal( |
176 this.uri, this.id, this.expected, this.actual, this.text); | 176 this.uri, this.id, this.expected, this.actual, this.text); |
177 | 177 |
178 String toString() { | 178 String toString() { |
179 StringBuffer sb = new StringBuffer(); | 179 StringBuffer sb = new StringBuffer(); |
180 sb.write('FAILED: $id\n'); | 180 sb.write('FAILED: $id\n'); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 /// The result of a single test for a single test step. | 222 /// The result of a single test for a single test step. |
223 class TestStatus { | 223 class TestStatus { |
224 final TestConfiguration config; | 224 final TestConfiguration config; |
225 final String status; | 225 final String status; |
226 | 226 |
227 TestStatus(this.config, this.status); | 227 TestStatus(this.config, this.status); |
228 | 228 |
229 String toString() => '$config: $status'; | 229 String toString() => '$config: $status'; |
230 } | 230 } |
OLD | NEW |