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

Unified Diff: pkg/unittest/unittest.dart

Issue 10909123: Fix issue 2933 - if an exception is thrown before we start the first test, but after the testcase i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/unittest.dart
===================================================================
--- pkg/unittest/unittest.dart (revision 11994)
+++ pkg/unittest/unittest.dart (working copy)
@@ -580,7 +580,8 @@
_testTeardown = null;
body();
} catch (e, trace) {
- _reportTestError(e.toString(), trace == null ? '' : trace.toString());
+ var stack = (trace == null) ? '' : ': ${trace.toString()}';
+ _uncaughtErrorMessage = "${e.toString()}$stack";
} finally {
// Now that the group is over, restore the previous one.
_currentGroup = parentGroup;
@@ -662,13 +663,15 @@
void _reportTestError(String msg, String trace) {
if (_currentTest < _tests.length) {
final testCase = _tests[_currentTest];
- testCase.error(msg, trace);
- if (testCase.callbackFunctionsOutstanding > 0) {
- _nextTestCase();
+ if (testCase.running) {
Siggi Cherem (dart-lang) 2012/09/07 19:27:37 this part should probably go away? (seems that you
+ testCase.error(msg, trace);
+ if (testCase.callbackFunctionsOutstanding > 0) {
+ _nextTestCase();
+ }
+ return;
}
- } else {
- _uncaughtErrorMessage = "$msg: $trace";
}
+ _uncaughtErrorMessage = "$msg: $trace";
}
/** Runs [callback] at the end of the event loop. */
« 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