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

Unified Diff: lib/unittest/unittest.dart

Issue 10827165: Reverted a couple of earlier cleanups to the unittest framework. They introduced issues with cases … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « lib/unittest/interactive_html_config.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/unittest.dart
===================================================================
--- lib/unittest/unittest.dart (revision 10238)
+++ lib/unittest/unittest.dart (working copy)
@@ -685,9 +685,13 @@
port.toSendPort().send(null, null);
}
+rerunTests() {
+ _uncaughtErrorMessage = null;
+ runTests();
+}
+
/** Runs all queued tests, one at a time. */
runTests() {
- _uncaughtErrorMessage = null;
_currentTest = 0;
_currentGroup = '';
@@ -704,7 +708,6 @@
_config.onStart();
_defer(() {
- expect(_currentTest, isZero);
_testRunner();
});
}
@@ -730,11 +733,8 @@
registerException(testNum, e, [trace]) {
trace = trace == null ? '' : trace.toString();
if (_tests[testNum].result == null) {
- if (e is ExpectException) {
- _tests[testNum].fail(e.message, trace);
- } else {
- _tests[testNum].fail('Caught $e', trace);
- }
+ String message = (e is ExpectException) ? e.message : 'Caught $e';
+ _tests[testNum].fail(message, trace);
} else {
_tests[testNum].error('Caught $e', trace);
}
@@ -779,7 +779,6 @@
case _ERROR: testsErrors_++; break;
}
}
-
_config.onDone(testsPassed_, testsFailed_, testsErrors_, _tests,
_uncaughtErrorMessage);
_initialized = false;
@@ -803,6 +802,7 @@
_tests = <TestCase>[];
_testRunner = _nextBatch;
+ _uncaughtErrorMessage = null;
if (_config == null) {
_config = new Configuration();
« no previous file with comments | « lib/unittest/interactive_html_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698