OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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 /** | 5 /** |
6 * testcase.dart: this file is sourced by unittest.dart. It defines [TestCase] | 6 * testcase.dart: this file is sourced by unittest.dart. It defines [TestCase] |
7 * and assumes unittest defines the type [TestFunction]. | 7 * and assumes unittest defines the type [TestFunction]. |
8 */ | 8 */ |
9 | 9 |
10 /** Summarizes information about a single test case. */ | 10 /** Summarizes information about a single test case. */ |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 test(); | 60 test(); |
61 } finally { | 61 } finally { |
62 if (_teardown != null) { | 62 if (_teardown != null) { |
63 _teardown(); | 63 _teardown(); |
64 } | 64 } |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 void pass() { | 68 void pass() { |
69 result = _PASS; | 69 result = _PASS; |
| 70 _config.onTestResult(this); |
70 } | 71 } |
71 | 72 |
72 void fail(String message, String stackTrace) { | 73 void fail(String message, String stackTrace) { |
73 result = _FAIL; | 74 result = _FAIL; |
74 this.message = message; | 75 this.message = message; |
75 this.stackTrace = stackTrace; | 76 this.stackTrace = stackTrace; |
| 77 _config.onTestResult(this); |
76 } | 78 } |
77 | 79 |
78 void error(String message, String stackTrace) { | 80 void error(String message, String stackTrace) { |
79 result = _ERROR; | 81 result = _ERROR; |
80 this.message = message; | 82 this.message = message; |
81 this.stackTrace = stackTrace; | 83 this.stackTrace = stackTrace; |
| 84 _config.onTestResult(this); |
82 } | 85 } |
83 } | 86 } |
OLD | NEW |