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

Unified Diff: pkg/unittest/lib/src/config.dart

Issue 14917022: Added color coding to test results in VM config. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | pkg/unittest/lib/vm_config.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/config.dart
===================================================================
--- pkg/unittest/lib/src/config.dart (revision 22469)
+++ pkg/unittest/lib/src/config.dart (working copy)
@@ -160,6 +160,28 @@
}
/**
+ * Format a test result.
+ */
+ String formatResult(TestCase testCase) {
+ var result = new StringBuffer();
+ result.write(testCase.result.toUpperCase());
+ result.write(": ");
+ result.write(testCase.description);
+ result.write("\n");
+
+ if (testCase.message != '') {
+ result.write(_indent(testCase.message));
+ result.write("\n");
+ }
+
+ if (testCase.stackTrace != null && testCase.stackTrace != '') {
+ result.write(_indent(testCase.stackTrace));
+ result.write("\n");
+ }
+ return result.toString();
+ }
+
+ /**
* Called with the result of all test cases. The default implementation prints
* the result summary using the built-in [print] command. Browser tests
* commonly override this to reformat the output.
@@ -171,16 +193,7 @@
String uncaughtError) {
// Print each test's result.
for (final t in results) {
- var resultString = "${t.result}".toUpperCase();
- print('$resultString: ${t.description}');
-
- if (t.message != '') {
- print(_indent(t.message));
- }
-
- if (t.stackTrace != null && t.stackTrace != '') {
- print(_indent(t.stackTrace));
- }
+ print(formatResult(t));
Siggi Cherem (dart-lang) 2013/05/07 20:55:01 just to make sure, this is not affecting compact_v
}
// Show the summary.
« no previous file with comments | « no previous file | pkg/unittest/lib/vm_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698