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

Side by Side Diff: dart/lib/unittest/config.dart

Issue 10632017: Revert "Added the ability to filter which tests are run by name, using a --filter argument passed t… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 | « no previous file | dart/lib/unittest/unittest.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** This file is sourced by unitest.dart. */ 5 /** This file is sourced by unitest.dart. */
6 6
7 /** 7 /**
8 * Hooks to configure the unittest library for different platforms. This class 8 * Hooks to configure the unittest library for different platforms. This class
9 * implements the API in a platform-independent way. Tests that want to take 9 * implements the API in a platform-independent way. Tests that want to take
10 * advantage of the platform can create a subclass and override methods from 10 * advantage of the platform can create a subclass and override methods from
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 } 55 }
56 56
57 // Show the summary. 57 // Show the summary.
58 print(''); 58 print('');
59 59
60 var success = false; 60 var success = false;
61 if (passed == 0 && failed == 0 && errors == 0) { 61 if (passed == 0 && failed == 0 && errors == 0) {
62 print('No tests found.'); 62 print('No tests found.');
63 // This is considered a failure too: if this happens you probably have a 63 // This is considered a failure too: if this happens you probably have a
64 // bug in your unit tests, unless you are filtering. 64 // bug in your unit tests.
65 if (getFilter() != null) {
66 success = true;
67 }
68 } else if (failed == 0 && errors == 0 && uncaughtError == null) { 65 } else if (failed == 0 && errors == 0 && uncaughtError == null) {
69 print('All $passed tests passed.'); 66 print('All $passed tests passed.');
70 success = true; 67 success = true;
71 } else { 68 } else {
72 if (uncaughtError != null) { 69 if (uncaughtError != null) {
73 print('Top-level uncaught error: $uncaughtError'); 70 print('Top-level uncaught error: $uncaughtError');
74 } 71 }
75 print('$passed PASSED, $failed FAILED, $errors ERRORS'); 72 print('$passed PASSED, $failed FAILED, $errors ERRORS');
76 } 73 }
77 74
78 // An exception is used by the test infrastructure to detect failure. 75 // An exception is used by the test infrastructure to detect failure.
79 if (!success) throw new Exception("Some tests failed."); 76 if (!success) throw new Exception("Some tests failed.");
80 } 77 }
81 78
82 String _indent(String str) { 79 String _indent(String str) {
83 // TODO(nweiz): Use this simpler code once issue 2980 is fixed. 80 // TODO(nweiz): Use this simpler code once issue 2980 is fixed.
84 // return str.replaceAll(const RegExp("^", multiLine: true), " "); 81 // return str.replaceAll(const RegExp("^", multiLine: true), " ");
85 82
86 return Strings.join(str.split("\n").map((line) => " $line"), "\n"); 83 return Strings.join(str.split("\n").map((line) => " $line"), "\n");
87 } 84 }
88 } 85 }
OLDNEW
« no previous file with comments | « no previous file | dart/lib/unittest/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698