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 test_progress; | 5 library test_progress; |
6 | 6 |
7 import "dart:io"; | 7 import "dart:io"; |
8 import "test_runner.dart"; | 8 import "test_runner.dart"; |
9 import "test_suite.dart"; | 9 import "test_suite.dart"; |
10 import "status_file_parser.dart"; | 10 import "status_file_parser.dart"; |
| 11 import "http_server.dart" as http_server; |
11 | 12 |
12 class ProgressIndicator { | 13 class ProgressIndicator { |
13 ProgressIndicator(this._startTime, this._printTiming) | 14 ProgressIndicator(this._startTime, this._printTiming) |
14 : _tests = [], _failureSummary = []; | 15 : _tests = [], _failureSummary = []; |
15 | 16 |
16 factory ProgressIndicator.fromName(String name, | 17 factory ProgressIndicator.fromName(String name, |
17 Date startTime, | 18 Date startTime, |
18 bool printTiming) { | 19 bool printTiming) { |
19 switch (name) { | 20 switch (name) { |
20 case 'compact': | 21 case 'compact': |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 'contains binary data!'); | 189 'contains binary data!'); |
189 } else { | 190 } else { |
190 output.add(new String.fromCharCodes(test.lastCommandOutput.stdout)); | 191 output.add(new String.fromCharCodes(test.lastCommandOutput.stdout)); |
191 } | 192 } |
192 } | 193 } |
193 if (!test.lastCommandOutput.stderr.isEmpty) { | 194 if (!test.lastCommandOutput.stderr.isEmpty) { |
194 output.add(''); | 195 output.add(''); |
195 output.add('stderr:'); | 196 output.add('stderr:'); |
196 output.add(new String.fromCharCodes(test.lastCommandOutput.stderr)); | 197 output.add(new String.fromCharCodes(test.lastCommandOutput.stderr)); |
197 } | 198 } |
| 199 if (test is BrowserTestCase) { |
| 200 // Additional command for rerunning the steps locally after the fact. |
| 201 output.add('To retest, run: ' |
| 202 '${TestUtils.dartTestExecutable.toNativePath()} ' |
| 203 '${TestUtils.dartDir().toNativePath()}/tools/testing/dart/' |
| 204 'http_server.dart -m ${test.configuration["mode"]} ' |
| 205 '-a ${test.configuration["arch"]} ' |
| 206 '-p ${http_server.TestingServerRunner.serverList[0].port} ' |
| 207 '-c ${http_server.TestingServerRunner.serverList[1].port}'); |
| 208 } |
198 for (Command c in test.commands) { | 209 for (Command c in test.commands) { |
199 output.add(''); | 210 output.add(''); |
200 String message = (c == test.commands.last | 211 String message = (c == test.commands.last |
201 ? "Command line" : "Compilation command"); | 212 ? "Command line" : "Compilation command"); |
202 output.add('$message: ${c.commandLine}'); | 213 output.add('$message: ${c.commandLine}'); |
203 } | 214 } |
204 return output; | 215 return output; |
205 } | 216 } |
206 | 217 |
207 void _printFailureSummary() { | 218 void _printFailureSummary() { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 print(''); | 489 print(''); |
479 print('$config:'); | 490 print('$config:'); |
480 statuses.sort((a, b) => a.compareTo(b)); | 491 statuses.sort((a, b) => a.compareTo(b)); |
481 for (String status in statuses) { | 492 for (String status in statuses) { |
482 print(' $status'); | 493 print(' $status'); |
483 } | 494 } |
484 }); | 495 }); |
485 _printStatus(); | 496 _printStatus(); |
486 } | 497 } |
487 } | 498 } |
OLD | NEW |