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

Side by Side Diff: lib/src/engine.dart

Issue 933083002: Add a test runner executable. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « lib/src/console_reporter.dart ('k') | lib/src/exit_codes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library unittest.engine; 5 library unittest.engine;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'live_test.dart'; 10 import 'live_test.dart';
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 _onTestStartedController.add(liveTest); 57 _onTestStartedController.add(liveTest);
58 58
59 // First, schedule a microtask to ensure that [onTestStarted] fires before 59 // First, schedule a microtask to ensure that [onTestStarted] fires before
60 // the first [LiveTest.onStateChange] event. Once the test finishes, use 60 // the first [LiveTest.onStateChange] event. Once the test finishes, use
61 // [new Future] to do a coarse-grained event loop pump to avoid starving 61 // [new Future] to do a coarse-grained event loop pump to avoid starving
62 // the DOM or other non-microtask events. 62 // the DOM or other non-microtask events.
63 return new Future.microtask(liveTest.run).then((_) => new Future(() {})); 63 return new Future.microtask(liveTest.run).then((_) => new Future(() {}));
64 }).then((_) => 64 }).then((_) =>
65 liveTests.every((liveTest) => liveTest.state.result == Result.success)); 65 liveTests.every((liveTest) => liveTest.state.result == Result.success));
66 } 66 }
67
68 /// Signals that the caller is done paying attention to test results and the
69 /// engine should release any resources it has allocated.
70 Future close() =>
71 Future.wait(liveTests.map((liveTest) => liveTest.close()));
67 } 72 }
OLDNEW
« no previous file with comments | « lib/src/console_reporter.dart ('k') | lib/src/exit_codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698