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

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

Issue 9234002: Add summary of failures to end of test.dart output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 2fb056b0cae5080dc4b3117c262622e49053dbff..0b05726a30af7f4dc4de77581801cc646777423c 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -8,7 +8,8 @@
#import("test_suite.dart");
class ProgressIndicator {
- ProgressIndicator(this._startTime, this._printTiming) : _tests = [];
+ ProgressIndicator(this._startTime, this._printTiming)
+ : _tests = [], _failureSummary = [];
factory ProgressIndicator.fromName(String name,
Date startTime,
@@ -74,6 +75,7 @@ class ProgressIndicator {
}
void allDone() {
+ _printFailureSummary();
_printStatus();
_printTimingInformation();
exit(_failedTests > 0 ? 1 : 0);
@@ -108,27 +110,49 @@ class ProgressIndicator {
}
void _printFailureOutput(TestCase test) {
- print('\nFAILED: ${test.displayName}');
+ List<String> output = new List<String>();
+ output.add('');
+ output.add('FAILED: ${test.displayName}');
StringBuffer expected = new StringBuffer();
expected.add('Expected: ');
for (var expectation in test.expectedOutcomes) {
expected.add('$expectation ');
}
- print(expected.toString());
- print('Actual: ${test.output.result}');
+ output.add(expected.toString());
+ output.add('Actual: ${test.output.result}');
if (!test.output.stdout.isEmpty()) {
- print('\nstdout:');
- test.output.stdout.forEach((s) => print(s));
+ output.add('');
+ output.add('stdout:');
+ for (var s in test.output.stdout) {
+ output.add(s);
+ }
}
if (!test.output.stderr.isEmpty()) {
- print('\nstderr:');
- test.output.stderr.forEach((s) => print(s));
+ output.add('');
+ output.add('stderr:');
+ for (var s in test.output.stderr) {
+ output.add(s);
+ }
}
if (test is BrowserTestCase && test.dynamic.compilerPath != null) {
- print('\nCompilation command: ${test.dynamic.compilerPath} ' +
- Strings.join(test.dynamic.compilerArguments, ' '));
+ output.add('');
+ output.add('Compilation command: ${test.dynamic.compilerPath} ' +
+ Strings.join(test.dynamic.compilerArguments, ' '));
+ }
+ output.add('');
+ output.add('Command line: ${test.commandLine}');
+
+ for (String line in output) {
+ print(line);
+ }
+ _failureSummary.addAll(output);
+ }
+
+ void _printFailureSummary() {
+ for (String line in _failureSummary) {
+ print(line);
}
- print('\nCommand line: ${test.commandLine}');
+ print('');
}
void _printStatus() {
@@ -153,6 +177,7 @@ class ProgressIndicator {
Date _startTime;
bool _printTiming;
List<TestCase> _tests;
+ List<String> _failureSummary;
}
@@ -162,7 +187,10 @@ class CompactIndicator extends ProgressIndicator {
void allDone() {
stdout.write('\n'.charCodes());
+ _printFailureSummary();
_printTimingInformation();
+ _printProgress();
Mads Ager (google) 2012/01/16 10:45:00 Do you really want to print progress here again? I
Bill Hesse 2012/01/16 11:24:35 It is nice to have that as the last line of the ou
+ print('');
stdout.close();
exit(_failedTests > 0 ? 1 : 0);
}
« 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