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

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

Issue 22883008: starting to work on unit test config interface (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more cleanup 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
Index: pkg/unittest/lib/unittest.dart
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index 43365f4ec35e504017203036eaa440c94725887e..eb186bd51716d679f21bd52fc75eb9f79a17b6fb 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -146,13 +146,15 @@ library unittest;
import 'dart:async';
import 'dart:collection';
import 'dart:isolate';
+import 'package:stack_trace/stack_trace.dart';
+
import 'matcher.dart';
export 'matcher.dart';
-import 'package:stack_trace/stack_trace.dart';
-
import 'src/utils.dart';
-part 'src/config.dart';
+
+part 'src/configuration.dart';
+part 'src/simple_configuration.dart';
part 'src/test_case.dart';
Configuration _config;
@@ -656,16 +658,16 @@ void _nextTestCase() {
_runTest();
}
-/**
- * Utility function that can be used to notify the test framework that an
- * error was caught outside of this library.
- */
-void _reportTestError(String msg, trace) {
- if (_currentTestCaseIndex < testCases.length) {
- final testCase = testCases[_currentTestCaseIndex];
- testCase.error(msg, trace);
+/** Handle errors that happen outside the tests. */
+// TODO(vsm): figure out how to expose the stack trace here
+// Currently e.message works in dartium, but not in dartc.
+void handleExternalError(e, String message, [stack]) {
+ var msg = '$message\nCaught $e';
+
+ if (currentTestCase != null) {
+ currentTestCase.error(msg, stack);
} else {
- _uncaughtErrorMessage = "$msg: $trace";
+ _uncaughtErrorMessage = "$msg: $stack";
}
}

Powered by Google App Engine
This is Rietveld 408576698