Chromium Code Reviews| Index: tools/testing/dart/test_progress.dart |
| diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart |
| index 659fef5bae43a20c89975686430a8b78801b7a71..0c6b7a7264d217678063110eaf8aada60ae086b0 100644 |
| --- a/tools/testing/dart/test_progress.dart |
| +++ b/tools/testing/dart/test_progress.dart |
| @@ -128,6 +128,15 @@ List<String> _buildFailureOutput(TestCase test, |
| return output; |
| } |
| +String _buildSummaryEnd(int failedTests) { |
| + if (failedTests == 0) { |
| + return '\n===\n=== All tests succeeded\n===\n'; |
| + } else { |
| + var pluralSuffix = failedTests != 1 ? 's' : ''; |
| + return '\n===\n=== ${failedTests} test$pluralSuffix failed\n===\n'; |
| + } |
| +} |
| + |
| class EventListener { |
| void testAdded() { } |
| @@ -324,12 +333,14 @@ class TestFailurePrinter extends EventListener { |
| bool _printSummary; |
| var _formatter; |
| var _failureSummary = <String>[]; |
| + var _failedTests= 0; |
| TestFailurePrinter(this._printSummary, |
| [this._formatter = const Formatter()]); |
| void done(TestCase test) { |
| if (test.lastCommandOutput.unexpectedOutput) { |
| + _failedTests++; |
| var lines = _buildFailureOutput(test, _formatter); |
| for (var line in lines) { |
| print(line); |
| @@ -350,6 +361,8 @@ class TestFailurePrinter extends EventListener { |
| print(line); |
| } |
| print(''); |
| + |
| + print(_buildSummaryEnd(_failedTests)); |
|
kustermann
2013/05/02 14:13:00
If we want to print it always (not just if somethi
|
| } |
| } |
| } |
| @@ -397,28 +410,9 @@ class ProgressIndicator extends EventListener { |
| _allTestsKnown = true; |
| } |
| - void allDone() { |
| - _printStatus(); |
| - } |
| - |
| void _printStartProgress(TestCase test) {} |
| void _printDoneProgress(TestCase test) {} |
| - void _printStatus() { |
| - if (_failedTests == 0) { |
| - print('\n==='); |
| - print('=== All tests succeeded'); |
| - print('===\n'); |
| - } else { |
| - var pluralSuffix = _failedTests != 1 ? 's' : ''; |
| - print('\n==='); |
| - print('=== ${_failedTests} test$pluralSuffix failed'); |
| - print('===\n'); |
| - } |
| - } |
| - |
| - int get numFailedTests => _failedTests; |
| - |
| int _completedTests() => _passedTests + _failedTests; |
| int _foundTests = 0; |
| @@ -521,6 +515,6 @@ class BuildbotProgressIndicator extends ProgressIndicator { |
| } |
| print(''); |
| } |
| - super.allDone(); |
| + print(_buildSummaryEnd(_failedTests)); |
| } |
| } |