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

Unified Diff: lib/unittest/config.dart

Issue 10153005: unittest step 3 and 4: remove TestFramework.dart, make test.dart use (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | lib/unittest/dom_config.dart » ('j') | lib/unittest/html_print.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/config.dart
diff --git a/lib/unittest/config.dart b/lib/unittest/config.dart
index 88ecbf0765a0552f585247872723c1300cf3403e..c0a2f78daddb6cc67c700d16e4233caa3121c5e7 100644
--- a/lib/unittest/config.dart
+++ b/lib/unittest/config.dart
@@ -35,8 +35,12 @@ class Configuration {
* 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.
+ *
+ * When [uncaughtError] is not null, it contains an error that occured outside
+ * of tests (e.g. setting up the test).
*/
- void onDone(int passed, int failed, int errors, List<TestCase> results) {
+ void onDone(int passed, int failed, int errors, List<TestCase> results,
+ String uncaughtError) {
// Print each test's result.
for (final t in _tests) {
print('${t.result.toUpperCase()}: ${t.description}');
@@ -54,10 +58,13 @@ class Configuration {
print('No tests found.');
// This is considered a failure too: if this happens you probably have a
// bug in your unit tests.
- } else if (failed == 0 && errors == 0) {
+ } else if (failed == 0 && errors == 0 && uncaughtError == null) {
print('All $passed tests passed.');
success = true;
} else {
+ if (uncaughtError != null) {
+ print('Top-level uncaught error: $uncaughtError');
+ }
print('$passed PASSED, $failed FAILED, $errors ERRORS');
}
« no previous file with comments | « no previous file | lib/unittest/dom_config.dart » ('j') | lib/unittest/html_print.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698