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; |
kevmoo
2015/02/19 23:13:18
Mark the library as deprecated – its lights up nic
| |
6 | 6 |
7 import 'simple_configuration.dart'; | |
8 import 'test_case.dart'; | 7 import 'test_case.dart'; |
9 | 8 |
10 /// Describes the interface used by the unit test system for communicating the | 9 /// This is a stub class used to preserve compatibility with unittest 0.11.*. |
11 /// results of a test run. | 10 /// |
12 abstract class Configuration { | 11 /// It will be removed before the next version is released. |
13 /// Creates an instance of [SimpleConfiguration]. | 12 @deprecated |
14 factory Configuration() => new SimpleConfiguration(); | 13 class Configuration { |
15 | 14 Configuration(); |
16 /// Creates an [Configuration] instances that does nothing. | |
17 /// | |
18 /// For use by subclasses which wish to implement only a subset of features. | |
19 Configuration.blank(); | 15 Configuration.blank(); |
20 | 16 |
21 /// If `true`, tests are started automatically once they're finished being | |
22 /// defined. | |
23 /// | |
24 /// Otherwise, [runTests] must be called explicitly after tests are set up. | |
25 final autoStart = true; | 17 final autoStart = true; |
26 | |
27 /// How long a [TestCase] can run before it is considered an error. | |
28 /// A [timeout] value of [:null:] means that the limit is infinite. | |
29 Duration timeout = const Duration(minutes: 2); | 18 Duration timeout = const Duration(minutes: 2); |
30 | |
31 /// Called as soon as the unittest framework becomes initialized. | |
32 /// | |
33 /// This is done even before tests are added to the test framework. It might | |
34 /// be used to determine/debug errors that occur before the test harness | |
35 /// starts executing. It is also used to tell the vm or browser that tests are | |
36 /// going to be run asynchronously and that the process should wait until they | |
37 /// are done. | |
38 void onInit() {} | 19 void onInit() {} |
39 | |
40 /// Called as soon as the unittest framework starts running. | |
41 void onStart() {} | 20 void onStart() {} |
42 | |
43 /// Called when each test starts. Useful to show intermediate progress on | |
44 /// a test suite. | |
45 void onTestStart(TestCase testCase) {} | 21 void onTestStart(TestCase testCase) {} |
46 | |
47 /// Called when each test is first completed. Useful to show intermediate | |
48 /// progress on a test suite. | |
49 void onTestResult(TestCase testCase) {} | 22 void onTestResult(TestCase testCase) {} |
50 | |
51 /// Called when an already completed test changes state. For example: a test | |
52 /// that was marked as passing may later be marked as being in error because | |
53 /// it still had callbacks being invoked. | |
54 void onTestResultChanged(TestCase testCase) {} | 23 void onTestResultChanged(TestCase testCase) {} |
55 | |
56 /// Handles the logging of messages by a test case. | |
57 void onLogMessage(TestCase testCase, String message) {} | 24 void onLogMessage(TestCase testCase, String message) {} |
58 | |
59 /// Called when the unittest framework is done running. [success] indicates | |
60 /// whether all tests passed successfully. | |
61 void onDone(bool success) {} | 25 void onDone(bool success) {} |
62 | |
63 /// Called with the result of all test cases. Browser tests commonly override | |
64 /// this to reformat the output. | |
65 /// | |
66 /// When [uncaughtError] is not null, it contains an error that occured outsid e | |
67 /// of tests (e.g. setting up the test). | |
68 void onSummary(int passed, int failed, int errors, List<TestCase> results, | 26 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
69 String uncaughtError) {} | 27 String uncaughtError) {} |
70 } | 28 } |
OLD | NEW |