| OLD | NEW |
| 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 library unittest.configuration; | 5 library unittest.configuration; |
| 6 | 6 |
| 7 import 'package:unittest/unittest.dart' show TestCase, SimpleConfiguration; | 7 import 'simple_configuration.dart'; |
| 8 import 'test_case.dart'; |
| 8 | 9 |
| 9 /// Describes the interface used by the unit test system for communicating the | 10 /// Describes the interface used by the unit test system for communicating the |
| 10 /// results of a test run. | 11 /// results of a test run. |
| 11 abstract class Configuration { | 12 abstract class Configuration { |
| 12 | |
| 13 /// Creates an instance of [SimpleConfiguration]. | 13 /// Creates an instance of [SimpleConfiguration]. |
| 14 factory Configuration() => new SimpleConfiguration(); | 14 factory Configuration() => new SimpleConfiguration(); |
| 15 | 15 |
| 16 /// Creates an [Configuration] instances that does nothing. | 16 /// Creates an [Configuration] instances that does nothing. |
| 17 /// | 17 /// |
| 18 /// For use by subclasses which wish to implement only a subset of features. | 18 /// For use by subclasses which wish to implement only a subset of features. |
| 19 Configuration.blank(); | 19 Configuration.blank(); |
| 20 | 20 |
| 21 /// If [:true:], tests are started automatically. Otherwise [runTests] | 21 /// If `true`, tests are started automatically once they're finished being def
ined. |
| 22 /// must be called explicitly after tests are set up. | 22 /// |
| 23 bool get autoStart => true; | 23 /// Otherwise, [runTests] must be called explicitly after tests are set up. |
| 24 final autoStart = true; |
| 24 | 25 |
| 25 /// How long a [TestCase] can run before it is considered an error. | 26 /// How long a [TestCase] can run before it is considered an error. |
| 26 /// A [timeout] value of [:null:] means that the limit is infinite. | 27 /// A [timeout] value of [:null:] means that the limit is infinite. |
| 27 Duration timeout = const Duration(minutes: 2); | 28 Duration timeout = const Duration(minutes: 2); |
| 28 | 29 |
| 29 /// Called as soon as the unittest framework becomes initialized. | 30 /// Called as soon as the unittest framework becomes initialized. |
| 30 /// | 31 /// |
| 31 /// This is done even before tests are added to the test framework. It might | 32 /// This is done even before tests are added to the test framework. It might |
| 32 /// be used to determine/debug errors that occur before the test harness | 33 /// be used to determine/debug errors that occur before the test harness |
| 33 /// starts executing. It is also used to tell the vm or browser that tests are | 34 /// starts executing. It is also used to tell the vm or browser that tests are |
| (...skipping 26 matching lines...) Expand all Loading... |
| 60 | 61 |
| 61 /// Called with the result of all test cases. Browser tests commonly override | 62 /// Called with the result of all test cases. Browser tests commonly override |
| 62 /// this to reformat the output. | 63 /// this to reformat the output. |
| 63 /// | 64 /// |
| 64 /// When [uncaughtError] is not null, it contains an error that occured outsid
e | 65 /// When [uncaughtError] is not null, it contains an error that occured outsid
e |
| 65 /// of tests (e.g. setting up the test). | 66 /// of tests (e.g. setting up the test). |
| 66 void onSummary(int passed, int failed, int errors, List<TestCase> results, | 67 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
| 67 String uncaughtError) {} | 68 String uncaughtError) {} |
| 68 } | 69 } |
| 69 | 70 |
| OLD | NEW |