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

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

Issue 10037027: unittest step2: bye bye to multiple entrypoints for unittest (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 | « lib/unittest/shared.dart ('k') | lib/unittest/unittest.dart » ('j') | no next file with comments »
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 /**
6 * testcase.dart: this file is sourced by unittest.dart. It defines [TestCase]
7 * and assumes unittest defines the type [TestFunction].
8 */
9
10 /** Summarizes information about a single test case. */
11 class TestCase {
12 /** Identifier for this test. */
13 final int id;
14
15 /** A description of what the test is specifying. */
16 final String description;
17
18 /** The body of the test case. */
19 final TestFunction test;
20
21 /** Total number of callbacks to wait for before the test completes. */
22 int callbacks;
23
24 /** Error or failure message. */
25 String message = '';
26
27 /**
28 * One of [_PASS], [_FAIL], or [_ERROR] or [null] if the test hasn't run yet.
29 */
30 String result;
31
32 /** Stack trace associated with this test, or null if it succeeded. */
33 String stackTrace;
34
35 Date startTime;
36
37 Duration runningTime;
38
39 TestCase(this.id, this.description, this.test, this.callbacks);
40
41 bool get isComplete() => result != null;
42
43 void pass() {
44 result = _PASS;
45 }
46
47 void fail(String message, String stackTrace) {
48 result = _FAIL;
49 this.message = message;
50 this.stackTrace = stackTrace;
51 }
52
53 void error(String message, String stackTrace) {
54 result = _ERROR;
55 this.message = message;
56 this.stackTrace = stackTrace;
57 }
58 }
59
60
OLDNEW
« no previous file with comments | « lib/unittest/shared.dart ('k') | lib/unittest/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698