| 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 "dart:io" as io; |
| 8 import "http_server.dart" as http_server; | 9 import "http_server.dart" as http_server; |
| 9 import "status_file_parser.dart"; | 10 import "status_file_parser.dart"; |
| 10 import "test_runner.dart"; | 11 import "test_runner.dart"; |
| 11 import "test_suite.dart"; | 12 import "test_suite.dart"; |
| 12 import "utils.dart"; | 13 import "utils.dart"; |
| 13 | 14 |
| 14 class ProgressIndicator { | 15 class ProgressIndicator { |
| 15 ProgressIndicator(this._startTime, this._printTiming) | 16 ProgressIndicator(this._startTime, this._printTiming) |
| 16 : _tests = [], _failureSummary = []; | 17 : _tests = [], _failureSummary = []; |
| 17 | 18 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 | 106 |
| 106 void allDone() { | 107 void allDone() { |
| 107 _printFailureSummary(); | 108 _printFailureSummary(); |
| 108 _printStatus(); | 109 _printStatus(); |
| 109 _printSkippedCompilationInfo(); | 110 _printSkippedCompilationInfo(); |
| 110 _printTimingInformation(); | 111 _printTimingInformation(); |
| 111 stdout.close(); | 112 stdout.close(); |
| 112 stderr.close(); | 113 stderr.close(); |
| 113 if (_failedTests > 0) exit(1); | 114 if (_failedTests > 0) { |
| 115 io.exitCode = 1; |
| 116 } |
| 114 } | 117 } |
| 115 | 118 |
| 116 void _printStartProgress(TestCase test) {} | 119 void _printStartProgress(TestCase test) {} |
| 117 void _printDoneProgress(TestCase test) {} | 120 void _printDoneProgress(TestCase test) {} |
| 118 | 121 |
| 119 String _pad(String s, int length) { | 122 String _pad(String s, int length) { |
| 120 StringBuffer buffer = new StringBuffer(); | 123 StringBuffer buffer = new StringBuffer(); |
| 121 for (int i = s.length; i < length; i++) { | 124 for (int i = s.length; i < length; i++) { |
| 122 buffer.add(' '); | 125 buffer.add(' '); |
| 123 } | 126 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 _printFailureSummary(); | 283 _printFailureSummary(); |
| 281 _printSkippedCompilationInfo(); | 284 _printSkippedCompilationInfo(); |
| 282 _printTimingInformation(); | 285 _printTimingInformation(); |
| 283 if (_failedTests > 0) { | 286 if (_failedTests > 0) { |
| 284 // We may have printed many failure logs, so reprint the summary data. | 287 // We may have printed many failure logs, so reprint the summary data. |
| 285 _printProgress(); | 288 _printProgress(); |
| 286 print(''); | 289 print(''); |
| 287 } | 290 } |
| 288 stdout.close(); | 291 stdout.close(); |
| 289 stderr.close(); | 292 stderr.close(); |
| 290 if (_failedTests > 0) exit(1); | 293 if (_failedTests > 0) { |
| 294 io.exitCode = 1; |
| 295 } |
| 291 } | 296 } |
| 292 | 297 |
| 293 void allTestsKnown() { | 298 void allTestsKnown() { |
| 294 if (!_allTestsKnown && SummaryReport.total > 0) { | 299 if (!_allTestsKnown && SummaryReport.total > 0) { |
| 295 // Clear progress indicator before printing summary report. | 300 // Clear progress indicator before printing summary report. |
| 296 stdout.write( | 301 stdout.write( |
| 297 '\r \r'.charCodes); | 302 '\r \r'.charCodes); |
| 298 SummaryReport.printReport(); | 303 SummaryReport.printReport(); |
| 299 } | 304 } |
| 300 _allTestsKnown = true; | 305 _allTestsKnown = true; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 print(''); | 495 print(''); |
| 491 print('$config:'); | 496 print('$config:'); |
| 492 statuses.sort((a, b) => a.compareTo(b)); | 497 statuses.sort((a, b) => a.compareTo(b)); |
| 493 for (String status in statuses) { | 498 for (String status in statuses) { |
| 494 print(' $status'); | 499 print(' $status'); |
| 495 } | 500 } |
| 496 }); | 501 }); |
| 497 _printStatus(); | 502 _printStatus(); |
| 498 } | 503 } |
| 499 } | 504 } |
| OLD | NEW |