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

Unified Diff: pkg/unittest/lib/src/config.dart

Issue 13261006: pkg/unittest: cleanup to logMessage (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nit Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/unittest/lib/unittest.dart » ('j') | pkg/unittest/lib/unittest.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/config.dart
diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
index b557783464d9a40ae055e264b5669bf7c2c7bb9e..da9d3fd1ca0883e3fd223c243853c513b6c4e9db 100644
--- a/pkg/unittest/lib/src/config.dart
+++ b/pkg/unittest/lib/src/config.dart
@@ -21,13 +21,13 @@ class Configuration {
* Particularly useful in cases where we have parent/child configurations
* such as layout tests.
*/
- String get name => 'Configuration';
+ final String name = 'Configuration';
kevmoo-old 2013/03/29 02:19:25 Silly to have const values for getters. final is c
Andrei Mouravski 2013/03/29 13:34:09 Also silly to use final instead of const. Also rem
kevmoo-old 2013/03/29 14:38:36 At the moment, I'm playing a game against dart_doc
kevmoo-old 2013/04/01 19:14:36 Related dart_doc bug: https://code.google.com/p/da
/**
* If true, then tests are started automatically (otherwise [runTests]
* must be called explicitly after the tests are set up.
*/
- bool get autoStart => true;
+ final bool autoStart = true;
/**
* Called as soon as the unittest framework becomes initialized. This is done
@@ -70,21 +70,6 @@ class Configuration {
}
/**
- * Can be called by tests to log status. Tests should use this
kevmoo-old 2013/03/29 02:19:25 Adds no value over the top-level logMessage method
- * instead of print. Subclasses should not override this; they
- * should instead override logMessage which is passed the test case.
- */
- void logMessage(String message) {
- if (currentTestCase == null) {
- // Before or after tests run. In this case we pass null for the test
- // case reference and let the config decide what to do with this.
- logTestCaseMessage(null, message);
- } else {
- logTestCaseMessage(currentTestCase, message);
- }
- }
-
- /**
* Handles the logging of messages by a test case. The default in
* this base configuration is to call print();
*/
@@ -103,7 +88,7 @@ class Configuration {
void onSummary(int passed, int failed, int errors, List<TestCase> results,
String uncaughtError) {
// Print each test's result.
- for (final t in testCases) {
+ for (final t in results) {
kevmoo-old 2013/03/29 02:19:25 Should use the method arg
var resultString = "${t.result}".toUpperCase();
print('$resultString: ${t.description}');
@@ -119,13 +104,11 @@ class Configuration {
// Show the summary.
print('');
- var success = false;
kevmoo-old 2013/03/29 02:19:25 Not used
if (passed == 0 && failed == 0 && errors == 0 && uncaughtError == null) {
print('No tests found.');
// This is considered a failure too.
} else if (failed == 0 && errors == 0 && uncaughtError == null) {
print('All $passed tests passed.');
- success = true;
} else {
if (uncaughtError != null) {
print('Top-level uncaught error: $uncaughtError');
« no previous file with comments | « no previous file | pkg/unittest/lib/unittest.dart » ('j') | pkg/unittest/lib/unittest.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698