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

Unified Diff: lib/src/frontend/expect.dart

Issue 1056733002: Run test tearDowns and clean up temporary directories when a signal is caught. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 9 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/src/executable.dart ('k') | lib/src/runner/browser/compiler_pool.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/frontend/expect.dart
diff --git a/lib/src/frontend/expect.dart b/lib/src/frontend/expect.dart
index 71a141694f42ba7f0a04415ca4f34651430672c0..d39986b40231df2599403430c43909ff703e40e5 100644
--- a/lib/src/frontend/expect.dart
+++ b/lib/src/frontend/expect.dart
@@ -6,6 +6,9 @@ library test.frontend.expect;
import 'package:matcher/matcher.dart';
+import '../backend/closed_exception.dart';
+import '../backend/invoker.dart';
+
/// An exception thrown when a test assertion fails.
class TestFailure {
final String message;
@@ -36,6 +39,8 @@ typedef String ErrorFormatter(
/// [verbose] should be specified as `true`.
void expect(actual, matcher,
{String reason, bool verbose: false, ErrorFormatter formatter}) {
+ if (Invoker.current.closed) throw new ClosedException();
+
matcher = wrapMatcher(matcher);
var matchState = {};
try {
« no previous file with comments | « lib/src/executable.dart ('k') | lib/src/runner/browser/compiler_pool.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698