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

Side by Side Diff: pkg/unittest/test/unittest_test_utils.dart

Issue 22999020: pkg/unittest: give Configuration a default (blank) implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/lib/src/simple_configuration.dart ('k') | no next file » | 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) 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 part of unittestTest; 5 part of unittestTest;
6 6
7 Future _defer(void fn()) { 7 Future _defer(void fn()) {
8 return new Future.sync(fn); 8 return new Future.sync(fn);
9 } 9 }
10 10
(...skipping 15 matching lines...) Expand all
26 totalTests = results.length; 26 totalTests = results.length;
27 for (var i = 0; i < results.length; i++) { 27 for (var i = 0; i < results.length; i++) {
28 testDetails.write(':${results[i].description}:' 28 testDetails.write(':${results[i].description}:'
29 '${collapseWhitespace(results[i].message)}'); 29 '${collapseWhitespace(results[i].message)}');
30 } 30 }
31 } 31 }
32 return '$passed:$failed:$errors:$totalTests:$count:' 32 return '$passed:$failed:$errors:$totalTests:$count:'
33 '$setup:$teardown:$uncaughtError$testDetails'; 33 '$setup:$teardown:$uncaughtError$testDetails';
34 } 34 }
35 35
36 class TestConfiguration extends SimpleConfiguration { 36 class TestConfiguration extends Configuration {
37 37
38 // Some test state that is captured. 38 // Some test state that is captured.
39 int count = 0; // A count of callbacks. 39 int count = 0; // A count of callbacks.
40 String setup = ''; // The name of the test group setup function, if any. 40 String setup = ''; // The name of the test group setup function, if any.
41 String teardown = ''; // The name of the group teardown function, if any. 41 String teardown = ''; // The name of the group teardown function, if any.
42 42
43 // The port to communicate with the parent isolate 43 // The port to communicate with the parent isolate
44 final SendPort _port; 44 final SendPort _port;
45 String _result; 45 String _result;
46 46
47 TestConfiguration(this._port); 47 TestConfiguration(this._port) : super.blank();
48
49 void onInit() {}
50 48
51 void onSummary(int passed, int failed, int errors, List<TestCase> results, 49 void onSummary(int passed, int failed, int errors, List<TestCase> results,
52 String uncaughtError) { 50 String uncaughtError) {
53 _result = buildStatusString(passed, failed, errors, results, 51 _result = buildStatusString(passed, failed, errors, results,
54 count: count, setup: setup, teardown: teardown, 52 count: count, setup: setup, teardown: teardown,
55 uncaughtError: uncaughtError); 53 uncaughtError: uncaughtError);
56 } 54 }
57 55
58 void onDone(bool success) { 56 void onDone(bool success) {
59 _port.send(_result); 57 _port.send(_result);
(...skipping 28 matching lines...) Expand all
88 }); 86 });
89 } 87 }
90 88
91 main() { 89 main() {
92 spawnFunction(runTestInIsolate) 90 spawnFunction(runTestInIsolate)
93 .call('') 91 .call('')
94 .then((String msg) { 92 .then((String msg) {
95 expect(msg.trim(), equals(expected)); 93 expect(msg.trim(), equals(expected));
96 }); 94 });
97 } 95 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/src/simple_configuration.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698