| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:async"; | 7 import "dart:async"; |
| 8 import "dart:io"; | 8 import "dart:io"; |
| 9 import "dart:io" as io; | 9 import "dart:io" as io; |
| 10 import "dart:convert" show JSON; | 10 import "dart:convert" show JSON; |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 print("\nCopied core dump and binary for unexpected crash to: " | 301 print("\nCopied core dump and binary for unexpected crash to: " |
| 302 "$dir"); | 302 "$dir"); |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 } | 307 } |
| 308 | 308 |
| 309 | 309 |
| 310 class SummaryPrinter extends EventListener { | 310 class SummaryPrinter extends EventListener { |
| 311 final bool jsonOnly; |
| 312 |
| 313 SummaryPrinter({this.jsonOnly}); |
| 314 |
| 311 void allTestsKnown() { | 315 void allTestsKnown() { |
| 312 if (summaryReport.total > 0) { | 316 if (jsonOnly) { |
| 317 print("JSON:"); |
| 318 print(JSON.encode(summaryReport.values)); |
| 319 } else { |
| 313 summaryReport.printReport(); | 320 summaryReport.printReport(); |
| 314 } | 321 } |
| 315 } | 322 } |
| 316 } | 323 } |
| 317 | 324 |
| 318 | 325 |
| 319 class TimingPrinter extends EventListener { | 326 class TimingPrinter extends EventListener { |
| 320 final _command2testCases = new Map<Command, List<TestCase>>(); | 327 final _command2testCases = new Map<Command, List<TestCase>>(); |
| 321 final _commandOutputs = new Set<CommandOutput>(); | 328 final _commandOutputs = new Set<CommandOutput>(); |
| 322 DateTime _startTime; | 329 DateTime _startTime; |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 return new VerboseProgressIndicator(startTime); | 669 return new VerboseProgressIndicator(startTime); |
| 663 case 'status': | 670 case 'status': |
| 664 return new ProgressIndicator(startTime); | 671 return new ProgressIndicator(startTime); |
| 665 case 'buildbot': | 672 case 'buildbot': |
| 666 return new BuildbotProgressIndicator(startTime); | 673 return new BuildbotProgressIndicator(startTime); |
| 667 default: | 674 default: |
| 668 assert(false); | 675 assert(false); |
| 669 break; | 676 break; |
| 670 } | 677 } |
| 671 } | 678 } |
| OLD | NEW |