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

Side by Side Diff: lib/unittest.dart

Issue 971123002: Add a variant on ConsoleReporter that doesn't import dart:io. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « lib/src/utils.dart ('k') | test/compact_reporter_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library unittest; 5 library unittest;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:path/path.dart' as p; 9 import 'package:path/path.dart' as p;
10 10
11 import 'src/backend/declarer.dart'; 11 import 'src/backend/declarer.dart';
12 import 'src/backend/invoker.dart'; 12 import 'src/backend/invoker.dart';
13 import 'src/backend/suite.dart'; 13 import 'src/backend/suite.dart';
14 import 'src/deprecated/configuration.dart'; 14 import 'src/deprecated/configuration.dart';
15 import 'src/deprecated/test_case.dart'; 15 import 'src/deprecated/test_case.dart';
16 import 'src/runner/console_reporter.dart'; 16 import 'src/runner/reporter/no_io_compact.dart';
17 17
18 export 'package:matcher/matcher.dart'; 18 export 'package:matcher/matcher.dart';
19 19
20 export 'src/deprecated/configuration.dart'; 20 export 'src/deprecated/configuration.dart';
21 export 'src/deprecated/simple_configuration.dart'; 21 export 'src/deprecated/simple_configuration.dart';
22 export 'src/deprecated/test_case.dart'; 22 export 'src/deprecated/test_case.dart';
23 export 'src/frontend/expect.dart'; 23 export 'src/frontend/expect.dart';
24 export 'src/frontend/expect_async.dart'; 24 export 'src/frontend/expect_async.dart';
25 export 'src/frontend/future_matchers.dart'; 25 export 'src/frontend/future_matchers.dart';
26 export 'src/frontend/prints_matcher.dart'; 26 export 'src/frontend/prints_matcher.dart';
(...skipping 15 matching lines...) Expand all
42 if (declarer != null) return declarer; 42 if (declarer != null) return declarer;
43 if (_globalDeclarer != null) return _globalDeclarer; 43 if (_globalDeclarer != null) return _globalDeclarer;
44 44
45 // Since there's no Zone-scoped declarer, the test file is being run directly. 45 // Since there's no Zone-scoped declarer, the test file is being run directly.
46 // In order to run the tests, we set up our own Declarer via 46 // In order to run the tests, we set up our own Declarer via
47 // [_globalDeclarer], and schedule a microtask to run the tests once they're 47 // [_globalDeclarer], and schedule a microtask to run the tests once they're
48 // finished being defined. 48 // finished being defined.
49 _globalDeclarer = new Declarer(); 49 _globalDeclarer = new Declarer();
50 scheduleMicrotask(() { 50 scheduleMicrotask(() {
51 var suite = new Suite(p.prettyUri(Uri.base), _globalDeclarer.tests); 51 var suite = new Suite(p.prettyUri(Uri.base), _globalDeclarer.tests);
52 // TODO(nweiz): Use a reporter that doesn't import dart:io here.
53 // TODO(nweiz): Set the exit code on the VM when issue 6943 is fixed. 52 // TODO(nweiz): Set the exit code on the VM when issue 6943 is fixed.
54 new ConsoleReporter([suite]).run(); 53 new NoIoCompactReporter([suite], color: true).run();
55 }); 54 });
56 return _globalDeclarer; 55 return _globalDeclarer;
57 } 56 }
58 57
59 // TODO(nweiz): This and other top-level functions should throw exceptions if 58 // TODO(nweiz): This and other top-level functions should throw exceptions if
60 // they're called after the declarer has finished declaring. 59 // they're called after the declarer has finished declaring.
61 void test(String description, body()) => _declarer.test(description, body); 60 void test(String description, body()) => _declarer.test(description, body);
62 61
63 void group(String description, void body()) => 62 void group(String description, void body()) =>
64 _declarer.group(description, body); 63 _declarer.group(description, body);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 void setSoloTest(int id) {} 141 void setSoloTest(int id) {}
143 142
144 @deprecated 143 @deprecated
145 void enableTest(int id) {} 144 void enableTest(int id) {}
146 145
147 @deprecated 146 @deprecated
148 void disableTest(int id) {} 147 void disableTest(int id) {}
149 148
150 @deprecated 149 @deprecated
151 withTestEnvironment(callback()) => callback(); 150 withTestEnvironment(callback()) => callback();
OLDNEW
« no previous file with comments | « lib/src/utils.dart ('k') | test/compact_reporter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698