OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 part of unittest; |
| 6 |
| 7 /** |
| 8 * Describes the interface used by the unit test system for communicating the |
| 9 * results of a test run. |
| 10 */ |
| 11 abstract class Configuration { |
| 12 |
| 13 /** |
| 14 * Creates an instance of [SimpleConfiguration]. |
| 15 */ |
| 16 factory Configuration() => new SimpleConfiguration(); |
| 17 |
| 18 /** |
| 19 * If [true], tests are started automatically. Otherwise [runTests] |
| 20 * must be called explicitly after tests are set up. |
| 21 */ |
| 22 bool get autoStart; |
| 23 |
| 24 /** |
| 25 * Called as soon as the unittest framework becomes initialized. This is done |
| 26 * even before tests are added to the test framework. It might be used to |
| 27 * determine/debug errors that occur before the test harness starts executing. |
| 28 * It is also used to tell the vm or browser that tests are going to be run |
| 29 * asynchronously and that the process should wait until they are done. |
| 30 */ |
| 31 void onInit(); |
| 32 |
| 33 /** Called as soon as the unittest framework starts running. */ |
| 34 void onStart() {} |
| 35 |
| 36 /** |
| 37 * Called when each test starts. Useful to show intermediate progress on |
| 38 * a test suite. |
| 39 */ |
| 40 void onTestStart(TestCase testCase); |
| 41 |
| 42 /** |
| 43 * Called when each test is first completed. Useful to show intermediate |
| 44 * progress on a test suite. |
| 45 */ |
| 46 void onTestResult(TestCase testCase); |
| 47 |
| 48 /** |
| 49 * Called when an already completed test changes state. For example: a test |
| 50 * that was marked as passing may later be marked as being in error because |
| 51 * it still had callbacks being invoked. |
| 52 */ |
| 53 void onTestResultChanged(TestCase testCase); |
| 54 |
| 55 /** |
| 56 * Handles the logging of messages by a test case. |
| 57 */ |
| 58 void onLogMessage(TestCase testCase, String message); |
| 59 |
| 60 /** |
| 61 * Called when the unittest framework is done running. [success] indicates |
| 62 * whether all tests passed successfully. |
| 63 */ |
| 64 void onDone(bool success); |
| 65 |
| 66 /** |
| 67 * Called with the result of all test cases. Browser tests commonly override |
| 68 * this to reformat the output. |
| 69 * |
| 70 * When [uncaughtError] is not null, it contains an error that occured outside |
| 71 * of tests (e.g. setting up the test). |
| 72 */ |
| 73 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
| 74 String uncaughtError); |
| 75 } |
| 76 |
OLD | NEW |