Chromium Code Reviews| 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 /** | |
|
Emily Fortuna
2012/04/10 18:14:12
should we be switching to the /// style comments?
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
we should talk more about this. For now I want to
| |
| 6 * Hooks to configure the unittest library for different platforms. This class | |
| 7 * implements the API in a platform-independent way. Tests that want to take | |
| 8 * advantage of the platform can create a subclass and override methods from | |
| 9 * this class. | |
| 10 */ | |
| 11 class Configuration { | |
| 12 /** | |
| 13 * Called as soon as the unittest framework becomes initialized. This is done | |
| 14 * even before tests are added to the test framework. It might be used to | |
| 15 * determine/debug errors that occur before the test harness starts executing. | |
| 16 */ | |
| 17 void onInit() {} | |
| 18 | |
| 19 /** | |
| 20 * Called as soon as the unittest framework starts running. Used commonly to | |
| 21 * tell the vm or browser that tests are still running and the process should | |
| 22 * wait until they are done. | |
| 23 */ | |
| 24 void onStart() {} | |
| 25 | |
| 26 /** | |
| 27 * Called when each test is completed. The default implementation throws an | |
| 28 * exception if the test failed. Other implementations might choose to ignore | |
| 29 * this callback and present a summary result in [onDone]. | |
| 30 */ | |
| 31 void onTestResult(TestCase testCase) { | |
| 32 if (testCase.result != _PASS) { | |
| 33 Expect.fail("FAIL: ${testCase.description}"); | |
|
Bob Nystrom
2012/04/10 20:04:25
Will this prevent subsequent tests in the suite fr
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
I changed this just to print the result. It was on
| |
| 34 } | |
| 35 } | |
| 36 | |
| 37 /** | |
| 38 * Called with the result of all test cases. The default implementation prints | |
| 39 * the result summary using the built-in [print] command. Browser tests | |
| 40 * commonly override this to reformat the output. | |
| 41 */ | |
| 42 void onDone(int passed, int failed, int errors, List<TestCase> results) { | |
| 43 if (failed == 0 && errors == 0) { | |
|
Bob Nystrom
2012/04/10 20:04:25
I think we should also report an error if there we
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
Done. Basically I moved the VM logic here and chan
| |
| 44 print("PASS"); | |
| 45 } | |
|
eub
2012/04/10 18:06:02
This implementation makes me scratch my head -- it
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
This was related to the way I was failing on onTes
| |
| 46 } | |
| 47 } | |
| OLD | NEW |