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

Side by Side Diff: pkg/scheduled_test/test/metatest.dart

Issue 337843008: Add a tearDown function to scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// A test library for testing test libraries? We must go deeper. 5 /// A test library for testing test libraries? We must go deeper.
6 /// 6 ///
7 /// Since unit testing code tends to use a lot of global state, it can be tough 7 /// Since unit testing code tends to use a lot of global state, it can be tough
8 /// to test. This library manages it by running each test case in a child 8 /// to test. This library manages it by running each test case in a child
9 /// isolate, then reporting the results back to the parent isolate. 9 /// isolate, then reporting the results back to the parent isolate.
10 library metatest; 10 library metatest;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 /// The port with which the child isolate should communicate with the parent 126 /// The port with which the child isolate should communicate with the parent
127 /// isolate. 127 /// isolate.
128 /// 128 ///
129 /// `null` in the parent isolate. 129 /// `null` in the parent isolate.
130 SendPort _replyTo; 130 SendPort _replyTo;
131 131
132 /// Whether or not we're running in a child isolate that's supposed to run a 132 /// Whether or not we're running in a child isolate that's supposed to run a
133 /// test. 133 /// test.
134 bool _inChildIsolate; 134 bool _inChildIsolate;
135 bool get inChildIsolate => _inChildIsolate;
135 136
136 /// Initialize metatest. 137 /// Initialize metatest.
137 /// 138 ///
138 /// [message] should be the second argument to [main]. It's used to determine 139 /// [message] should be the second argument to [main]. It's used to determine
139 /// whether this test is in the parent isolate or a child isolate. 140 /// whether this test is in the parent isolate or a child isolate.
140 void initMetatest(message) { 141 void initMetatest(message) {
141 if (message == null) { 142 if (message == null) {
142 _inChildIsolate = false; 143 _inChildIsolate = false;
143 } else { 144 } else {
144 _testToRun = message['testToRun']; 145 _testToRun = message['testToRun'];
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 "uncaughtError": uncaughtError, 232 "uncaughtError": uncaughtError,
232 "results": results.map((testCase) => { 233 "results": results.map((testCase) => {
233 "description": testCase.description, 234 "description": testCase.description,
234 "message": testCase.message, 235 "message": testCase.message,
235 "result": testCase.result, 236 "result": testCase.result,
236 "stackTrace": testCase.stackTrace.toString() 237 "stackTrace": testCase.stackTrace.toString()
237 }).toList() 238 }).toList()
238 }); 239 });
239 } 240 }
240 } 241 }
OLDNEW
« no previous file with comments | « pkg/scheduled_test/pubspec.yaml ('k') | pkg/scheduled_test/test/scheduled_test/tear_down_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698