| 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 /** Hooks to configure the unittest library for different platforms. */ |
| 6 interface Configuration default _DefaultConfiguration { |
| 7 /** |
| 8 * Called as soon as the unittest framework becomes initialized. This is done |
| 9 * even before tests are added to the test framework. It might be used to |
| 10 * determine/debug errors that occur before the test harness starts executing. |
| 11 */ |
| 12 void onInit(); |
| 13 |
| 14 /** |
| 15 * Called as soon as the unittest framework starts running. Used commonly to |
| 16 * tell the vm or browser that tests are still running and the process should |
| 17 * wait until they are done. |
| 18 */ |
| 19 void onStart(); |
| 20 |
| 21 /** |
| 22 * Called when each test is completed. The default implementation throws an |
| 23 * exception if the test failed. Other implementations might choose to ignore |
| 24 * this callback and present a summary result in [onDone]. |
| 25 */ |
| 26 void onTestResult(TestCase testCase); |
| 27 |
| 28 /** |
| 29 * Called with the result of all test cases. The default implementation prints |
| 30 * the result summary using the built-in [print] command. Browser tests |
| 31 * commonly override this to reformat the output. |
| 32 */ |
| 33 void onDone(int passed, int failed, int errors, List<TestCase> results); |
| 34 } |
| 35 |
| 36 // TODO(sigmund): make this the default config. |
| 37 //class _DefaultConfiguration() { |
| 38 // void onInit() {} |
| 39 // void onStart() {} |
| 40 // void onResult(TestCase testCase) { |
| 41 // if (testCase.result != _PASS) { |
| 42 // Expect.fail("FAIL: ${testCase.description}"); |
| 43 // } |
| 44 // } |
| 45 // void onDone(int passed, int failed, int errors, List<TestCase> results) { |
| 46 // if (failed == 0 && errors == 0) { |
| 47 // print("PASS"); |
| 48 // } |
| 49 // } |
| 50 //} |
| OLD | NEW |