| 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("test_runner.dart"); | 8 #import("test_runner.dart"); |
| 9 #import("test_suite.dart"); | 9 #import("test_suite.dart"); |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 print('=== All tests succeeded'); | 165 print('=== All tests succeeded'); |
| 166 print('===\n'); | 166 print('===\n'); |
| 167 } else { | 167 } else { |
| 168 var pluralSuffix = _failedTests != 1 ? 's' : ''; | 168 var pluralSuffix = _failedTests != 1 ? 's' : ''; |
| 169 print('\n==='); | 169 print('\n==='); |
| 170 print('=== ${_failedTests} test$pluralSuffix failed'); | 170 print('=== ${_failedTests} test$pluralSuffix failed'); |
| 171 print('===\n'); | 171 print('===\n'); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 int get numFailedTests() => _failedTests; |
| 176 |
| 175 int _completedTests() => _passedTests + _failedTests; | 177 int _completedTests() => _passedTests + _failedTests; |
| 176 | 178 |
| 177 int _foundTests = 0; | 179 int _foundTests = 0; |
| 178 int _passedTests = 0; | 180 int _passedTests = 0; |
| 179 int _failedTests = 0; | 181 int _failedTests = 0; |
| 180 bool _allTestsKnown = false; | 182 bool _allTestsKnown = false; |
| 181 Date _startTime; | 183 Date _startTime; |
| 182 bool _printTiming; | 184 bool _printTiming; |
| 183 List<TestCase> _tests; | 185 List<TestCase> _tests; |
| 184 List<String> _failureSummary; | 186 List<String> _failureSummary; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 var status = 'pass'; | 343 var status = 'pass'; |
| 342 if (test.output.unexpectedOutput) { | 344 if (test.output.unexpectedOutput) { |
| 343 status = 'fail'; | 345 status = 'fail'; |
| 344 } | 346 } |
| 345 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); | 347 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); |
| 346 print('Done ${test.configurationString} ${test.displayName}: $status'); | 348 print('Done ${test.configurationString} ${test.displayName}: $status'); |
| 347 print('@@@STEP_CLEAR@@@'); | 349 print('@@@STEP_CLEAR@@@'); |
| 348 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); | 350 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); |
| 349 } | 351 } |
| 350 } | 352 } |
| OLD | NEW |