| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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("test_runner.dart"); | 7 #import("test_runner.dart"); |
| 8 | 8 |
| 9 class ProgressIndicator { | 9 class ProgressIndicator { |
| 10 ProgressIndicator(this._startTime); | 10 ProgressIndicator(this._startTime); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 int _passedTests = 0; | 112 int _passedTests = 0; |
| 113 int _failedTests = 0; | 113 int _failedTests = 0; |
| 114 Date _startTime; | 114 Date _startTime; |
| 115 } | 115 } |
| 116 | 116 |
| 117 | 117 |
| 118 class CompactProgressIndicator extends ProgressIndicator { | 118 class CompactProgressIndicator extends ProgressIndicator { |
| 119 CompactProgressIndicator(Date startTime) : super(startTime); | 119 CompactProgressIndicator(Date startTime) : super(startTime); |
| 120 | 120 |
| 121 void allDone() { | 121 void allDone() { |
| 122 stdout.write('\n'.charCodes()); |
| 122 } | 123 } |
| 123 | 124 |
| 124 void _printProgress() { | 125 void _printProgress() { |
| 125 var percent = ((_completedTests() / _foundTests) * 100).floor().toString(); | 126 var percent = ((_completedTests() / _foundTests) * 100).floor().toString(); |
| 126 var percentPadded = _pad(percent, 5); | 127 var percentPadded = _pad(percent, 5); |
| 127 var passedPadded = _pad(_passedTests.toString(), 5); | 128 var passedPadded = _pad(_passedTests.toString(), 5); |
| 128 var failedPadded = _pad(_failedTests.toString(), 5); | 129 var failedPadded = _pad(_failedTests.toString(), 5); |
| 129 var progressLine = | 130 var progressLine = |
| 130 '\r[${_timeString()} | $percentPadded% | ' + | 131 '\r[${_timeString()} | $percentPadded% | ' + |
| 131 '+$passedPadded | -$failedPadded]'; | 132 '+$passedPadded | -$failedPadded]'; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 var status = 'pass'; | 208 var status = 'pass'; |
| 208 if (test.output.unexpectedOutput) { | 209 if (test.output.unexpectedOutput) { |
| 209 status = 'fail'; | 210 status = 'fail'; |
| 210 } | 211 } |
| 211 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); | 212 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); |
| 212 print('Done ${test.displayName}: $status'); | 213 print('Done ${test.displayName}: $status'); |
| 213 print('@@@STEP_CLEAR@@@'); | 214 print('@@@STEP_CLEAR@@@'); |
| 214 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); | 215 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); |
| 215 } | 216 } |
| 216 } | 217 } |
| OLD | NEW |