| 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 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (_failedTests > 0) { | 208 if (_failedTests > 0) { |
| 209 // We may have printed many failure logs, so reprint the summary data. | 209 // We may have printed many failure logs, so reprint the summary data. |
| 210 _printProgress(); | 210 _printProgress(); |
| 211 print(''); | 211 print(''); |
| 212 } | 212 } |
| 213 stdout.close(); | 213 stdout.close(); |
| 214 exit(_failedTests > 0 ? 1 : 0); | 214 exit(_failedTests > 0 ? 1 : 0); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void allTestsKnown() { | 217 void allTestsKnown() { |
| 218 if (!_allTestsKnown) { | 218 if (!_allTestsKnown && SummaryReport.total > 0) { |
| 219 // Clear progress indicator before printing summary report. | 219 // Clear progress indicator before printing summary report. |
| 220 stdout.write( | 220 stdout.write( |
| 221 '\r \r'.charCodes()); | 221 '\r \r'.charCodes()); |
| 222 SummaryReport.printReport(); | 222 SummaryReport.printReport(); |
| 223 } | 223 } |
| 224 _allTestsKnown = true; | 224 _allTestsKnown = true; |
| 225 } | 225 } |
| 226 | 226 |
| 227 void _printStartProgress(TestCase test) => _printProgress(); | 227 void _printStartProgress(TestCase test) => _printProgress(); |
| 228 void _printDoneProgress(TestCase test) => _printProgress(); | 228 void _printDoneProgress(TestCase test) => _printProgress(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 var status = 'pass'; | 341 var status = 'pass'; |
| 342 if (test.output.unexpectedOutput) { | 342 if (test.output.unexpectedOutput) { |
| 343 status = 'fail'; | 343 status = 'fail'; |
| 344 } | 344 } |
| 345 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); | 345 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); |
| 346 print('Done ${test.configurationString} ${test.displayName}: $status'); | 346 print('Done ${test.configurationString} ${test.displayName}: $status'); |
| 347 print('@@@STEP_CLEAR@@@'); | 347 print('@@@STEP_CLEAR@@@'); |
| 348 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); | 348 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); |
| 349 } | 349 } |
| 350 } | 350 } |
| OLD | NEW |