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

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

Issue 10387232: Remove string concatenation with + from all Dart files in tools directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 months 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
OLDNEW
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:builtin"); 8 #import("dart:builtin");
9 #import("test_runner.dart"); 9 #import("test_runner.dart");
10 #import("test_suite.dart"); 10 #import("test_suite.dart");
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 CompactProgressIndicator(Date startTime, bool printTiming) 245 CompactProgressIndicator(Date startTime, bool printTiming)
246 : super(startTime, printTiming); 246 : super(startTime, printTiming);
247 247
248 void _printProgress() { 248 void _printProgress() {
249 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); 249 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString();
250 var progressPadded = _pad(_allTestsKnown ? percent : '--', 3); 250 var progressPadded = _pad(_allTestsKnown ? percent : '--', 3);
251 var passedPadded = _pad(_passedTests.toString(), 5); 251 var passedPadded = _pad(_passedTests.toString(), 5);
252 var failedPadded = _pad(_failedTests.toString(), 5); 252 var failedPadded = _pad(_failedTests.toString(), 5);
253 Duration d = (new Date.now()).difference(_startTime); 253 Duration d = (new Date.now()).difference(_startTime);
254 var progressLine = 254 var progressLine =
255 '\r[${_timeString(d)} | $progressPadded% | ' + 255 '\r[${_timeString(d)} | $progressPadded% | '
256 '+$passedPadded | -$failedPadded]'; 256 '+$passedPadded | -$failedPadded]';
257 stdout.write(progressLine.charCodes()); 257 stdout.write(progressLine.charCodes());
258 } 258 }
259 } 259 }
260 260
261 261
262 class ColorProgressIndicator extends CompactIndicator { 262 class ColorProgressIndicator extends CompactIndicator {
263 ColorProgressIndicator(Date startTime, bool printTiming) 263 ColorProgressIndicator(Date startTime, bool printTiming)
264 : super(startTime, printTiming); 264 : super(startTime, printTiming);
265 265
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 var status = 'pass'; 351 var status = 'pass';
352 if (test.output.unexpectedOutput) { 352 if (test.output.unexpectedOutput) {
353 status = 'fail'; 353 status = 'fail';
354 } 354 }
355 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); 355 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString();
356 print('Done ${test.configurationString} ${test.displayName}: $status'); 356 print('Done ${test.configurationString} ${test.displayName}: $status');
357 print('@@@STEP_CLEAR@@@'); 357 print('@@@STEP_CLEAR@@@');
358 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); 358 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@');
359 } 359 }
360 } 360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698