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

Unified Diff: pkg/unittest/lib/compact_vm_config.dart

Issue 183013009: More fixes for compact_vm_config. The previous CL handled prints that occurred (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: pkg/unittest/lib/compact_vm_config.dart
diff --git a/pkg/unittest/lib/compact_vm_config.dart b/pkg/unittest/lib/compact_vm_config.dart
index c0f85b0a87594cff2937a03f9e4a6855b030a429..8c6ba12dee5c8a3f1ad5bdaa6e2c8bbf4b1ea70f 100644
--- a/pkg/unittest/lib/compact_vm_config.dart
+++ b/pkg/unittest/lib/compact_vm_config.dart
@@ -56,13 +56,13 @@ class CompactVMConfiguration extends VMConfiguration {
} else {
_fail++;
_progressLine(_start, _pass, _fail, test.description);
- stdout.write('\n');
+ _print();
if (test.message != '') {
- print(indent(test.message));
+ _print(indent(test.message));
}
if (test.stackTrace != null) {
- print(indent(test.stackTrace.toString()));
+ _print(indent(test.stackTrace.toString()));
}
}
}
@@ -71,13 +71,13 @@ class CompactVMConfiguration extends VMConfiguration {
_pass--;
_fail++;
_progressLine(_start, _pass, _fail, test.description);
- stdout.write('\n');
+ _print();
if (test.message != '') {
- print(indent(test.message));
+ _print(indent(test.message));
}
if (test.stackTrace != null) {
- print(indent(test.stackTrace.toString()));
+ _print(indent(test.stackTrace.toString()));
}
}
@@ -94,18 +94,18 @@ class CompactVMConfiguration extends VMConfiguration {
String uncaughtError) {
var success = false;
if (passed == 0 && failed == 0 && errors == 0 && uncaughtError == null) {
- print('\nNo tests ran.');
+ _print('\nNo tests ran.');
} else if (failed == 0 && errors == 0 && uncaughtError == null) {
_progressLine(_start, _pass, _fail, 'All tests passed!', _NONE);
- stdout.write('\n');
+ _print();
success = true;
} else {
_progressLine(_start, _pass, _fail, 'Some tests failed.', _RED);
- stdout.write('\n');
+ _print();
if (uncaughtError != null) {
- print('Top-level uncaught error: $uncaughtError');
+ _print('Top-level uncaught error: $uncaughtError');
}
- print('$passed PASSED, $failed FAILED, $errors ERRORS');
+ _print('$passed PASSED, $failed FAILED, $errors ERRORS');
}
}
@@ -201,6 +201,9 @@ class CompactVMConfiguration extends VMConfiguration {
}
}
+// TODO(sigmund): delete when dartbug.com/17269 is fixed (use `print` instead).
+_print([value = '']) => stdout.write('$value\n');
+
void useCompactVMConfiguration() {
// If the test is running on the Dart buildbots, we don't want to use this
// config since it's output may not be what the bots expect.
« 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