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

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

Issue 22859009: Changes to how we handle fancy stacks: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « pkg/unittest/lib/src/config.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/test_case.dart
===================================================================
--- pkg/unittest/lib/src/test_case.dart (revision 26539)
+++ pkg/unittest/lib/src/test_case.dart (working copy)
@@ -41,9 +41,9 @@
*/
String get result => _result;
- Trace _stackTrace;
+ StackTrace _stackTrace;
/** Stack trace associated with this test, or [null] if it succeeded. */
- Trace get stackTrace => _stackTrace;
+ StackTrace get stackTrace => _stackTrace;
/** The group (or groups) under which this test is running. */
final String currentGroup;
@@ -130,9 +130,10 @@
// Set the results, notify the config, and return true if this
// is the first time the result is being set.
- void _setResult(String testResult, String messageText, stack) {
+ void _setResult(String testResult, String messageText, StackTrace stack) {
_message = messageText;
_stackTrace = _getTrace(stack);
+ if (_stackTrace == null) _stackTrace = stack;
if (result == null) {
_result = testResult;
_config.onTestResult(this);
@@ -142,7 +143,8 @@
}
}
- void _complete(String testResult, [String messageText = '', stack]) {
+ void _complete(String testResult, [String messageText = '',
+ StackTrace stack]) {
if (runningTime == null) {
// The startTime can be `null` if an error happened during setup. In this
// case we simply report a running time of 0.
@@ -164,7 +166,7 @@
_complete(PASS);
}
- void fail(String messageText, [stack]) {
+ void fail(String messageText, [StackTrace stack]) {
if (result != null) {
String newMessage = (result == PASS)
? 'Test failed after initially passing: $messageText'
@@ -176,7 +178,7 @@
}
}
- void error(String messageText, [stack]) {
+ void error(String messageText, [StackTrace stack]) {
_complete(ERROR, messageText, stack);
}
« no previous file with comments | « pkg/unittest/lib/src/config.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698