| 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() : _startTime = new Date.now(); | 10 ProgressIndicator() : _startTime = new Date.now(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } else if (time < 10) { | 62 } else if (time < 10) { |
| 63 return '0$time'; | 63 return '0$time'; |
| 64 } else { | 64 } else { |
| 65 return '$time'; | 65 return '$time'; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 String _timeString() { | 69 String _timeString() { |
| 70 Duration d = (new Date.now()).difference(_startTime); | 70 Duration d = (new Date.now()).difference(_startTime); |
| 71 var min = d.inMinutes; | 71 var min = d.inMinutes; |
| 72 var sec = d.inSeconds; | 72 var sec = d.inSeconds % 60; |
| 73 return '${_padTime(min)}:${_padTime(sec)}'; | 73 return '${_padTime(min)}:${_padTime(sec)}'; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void _printFailureOutput(TestCase test) { | 76 void _printFailureOutput(TestCase test) { |
| 77 print('\nFAILED: ${test.displayName}'); | 77 print('\nFAILED: ${test.displayName}'); |
| 78 StringBuffer expected = new StringBuffer(); | 78 StringBuffer expected = new StringBuffer(); |
| 79 expected.add('Expected: '); | 79 expected.add('Expected: '); |
| 80 for (var expectation in test.expectedOutcomes) { | 80 for (var expectation in test.expectedOutcomes) { |
| 81 expected.add('$expectation '); | 81 expected.add('$expectation '); |
| 82 } | 82 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 var status = 'pass'; | 197 var status = 'pass'; |
| 198 if (test.output.unexpectedOutput) { | 198 if (test.output.unexpectedOutput) { |
| 199 status = 'fail'; | 199 status = 'fail'; |
| 200 } | 200 } |
| 201 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); | 201 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); |
| 202 print('Done ${test.displayName}: $status'); | 202 print('Done ${test.displayName}: $status'); |
| 203 print('@@@STEP_CLEAR@@@'); | 203 print('@@@STEP_CLEAR@@@'); |
| 204 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); | 204 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); |
| 205 } | 205 } |
| 206 } | 206 } |
| OLD | NEW |