Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: tools/testing/dart/test_progress.dart

Issue 8682005: Perform better activity tracking in test scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Hide more implementation details of ProcessQueue Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/test.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/test.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698