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

Side by Side Diff: pkg/unittest/lib/html_individual_config.dart

Issue 82113002: Refactoring to allow html_individual_config to pass with zero tests executed. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/html_enhanced_config.dart ('k') | tests/html/html.status » ('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) 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 /** 5 /**
6 * A unit test library for running groups of tests in a browser, instead of the 6 * A unit test library for running groups of tests in a browser, instead of the
7 * entire test file. This is especially used for large tests files that have 7 * entire test file. This is especially used for large tests files that have
8 * many subtests, so we can mark groups as failing at a finer granularity than 8 * many subtests, so we can mark groups as failing at a finer granularity than
9 * the entire test file. 9 * the entire test file.
10 * 10 *
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 var testGroupName = groups.single.split('=')[1]; 36 var testGroupName = groups.single.split('=')[1];
37 var startsWith = "$testGroupName${unittest.groupSep}"; 37 var startsWith = "$testGroupName${unittest.groupSep}";
38 unittest.filterTests((unittest.TestCase tc) => 38 unittest.filterTests((unittest.TestCase tc) =>
39 tc.description.startsWith(startsWith)); 39 tc.description.startsWith(startsWith));
40 } 40 }
41 } 41 }
42 super.onStart(); 42 super.onStart();
43 } 43 }
44
45 bool _failedOrErrors = false;
46 void onSummary(int passed, int failed, int errors, List<TestCase> results,
47 String uncaughtError) {
48 super.onSummary(passed, failed, errors, results, uncaughtError);
49
50 _failedOrErrors = failed > 0 || errors > 0;
51 }
52
53 void onDone(bool success) {
54 if (!success) {
55 success = !_failedOrErrors;
56 }
57 super.onDone(success);
58 }
44 } 59 }
45 60
46 void useHtmlIndividualConfiguration([bool isLayoutTest = false]) { 61 void useHtmlIndividualConfiguration([bool isLayoutTest = false]) {
47 unittest.unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonN otLayout; 62 unittest.unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonN otLayout;
48 } 63 }
49 64
50 final _singletonLayout = new HtmlIndividualConfiguration(true); 65 final _singletonLayout = new HtmlIndividualConfiguration(true);
51 final _singletonNotLayout = new HtmlIndividualConfiguration(false); 66 final _singletonNotLayout = new HtmlIndividualConfiguration(false);
OLDNEW
« no previous file with comments | « pkg/unittest/lib/html_enhanced_config.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698