Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: lib/unittest/config.dart

Issue 10031022: step 1 in making unittest platform independent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/unittest/html_print.dart » ('j') | lib/unittest/shared.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « no previous file | lib/unittest/html_print.dart » ('j') | lib/unittest/shared.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698