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

Unified Diff: tools/testing/dart/test_progress.dart

Issue 14718005: Print the number of failed tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698