| 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:builtin"); |
| 8 #import("test_runner.dart"); | 9 #import("test_runner.dart"); |
| 9 #import("test_suite.dart"); | 10 #import("test_suite.dart"); |
| 10 | 11 |
| 11 class ProgressIndicator { | 12 class ProgressIndicator { |
| 12 ProgressIndicator(this._startTime, this._printTiming) | 13 ProgressIndicator(this._startTime, this._printTiming) |
| 13 : _tests = [], _failureSummary = []; | 14 : _tests = [], _failureSummary = []; |
| 14 | 15 |
| 15 factory ProgressIndicator.fromName(String name, | 16 factory ProgressIndicator.fromName(String name, |
| 16 Date startTime, | 17 Date startTime, |
| 17 bool printTiming) { | 18 bool printTiming) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 List<String> _failureSummary; | 192 List<String> _failureSummary; |
| 192 } | 193 } |
| 193 | 194 |
| 194 | 195 |
| 195 class SilentProgressIndicator extends ProgressIndicator { | 196 class SilentProgressIndicator extends ProgressIndicator { |
| 196 SilentProgressIndicator(Date startTime, bool printTiming) | 197 SilentProgressIndicator(Date startTime, bool printTiming) |
| 197 : super(startTime, printTiming); | 198 : super(startTime, printTiming); |
| 198 void testAdded() { } | 199 void testAdded() { } |
| 199 void start(TestCase test) { } | 200 void start(TestCase test) { } |
| 200 void done(TestCase test) { } | 201 void done(TestCase test) { } |
| 202 void _printStartProgress(TestCase test) { } |
| 203 void _printDoneProgress(TestCase test) { } |
| 201 void allTestsKnown() { } | 204 void allTestsKnown() { } |
| 202 void allDone() { | 205 void allDone() { |
| 203 exit(0); | 206 exit(0); |
| 204 } | 207 } |
| 205 } | 208 } |
| 206 | 209 |
| 207 class CompactIndicator extends ProgressIndicator { | 210 class CompactIndicator extends ProgressIndicator { |
| 208 CompactIndicator(Date startTime, bool printTiming) | 211 CompactIndicator(Date startTime, bool printTiming) |
| 209 : super(startTime, printTiming); | 212 : super(startTime, printTiming); |
| 210 | 213 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 var status = 'pass'; | 351 var status = 'pass'; |
| 349 if (test.output.unexpectedOutput) { | 352 if (test.output.unexpectedOutput) { |
| 350 status = 'fail'; | 353 status = 'fail'; |
| 351 } | 354 } |
| 352 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); | 355 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); |
| 353 print('Done ${test.configurationString} ${test.displayName}: $status'); | 356 print('Done ${test.configurationString} ${test.displayName}: $status'); |
| 354 print('@@@STEP_CLEAR@@@'); | 357 print('@@@STEP_CLEAR@@@'); |
| 355 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); | 358 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); |
| 356 } | 359 } |
| 357 } | 360 } |
| OLD | NEW |