OLD | NEW |
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 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Since there's no Zone-scoped declarer, the test file is being run directly. | 48 // Since there's no Zone-scoped declarer, the test file is being run directly. |
49 // In order to run the tests, we set up our own Declarer via | 49 // In order to run the tests, we set up our own Declarer via |
50 // [_globalDeclarer], and schedule a microtask to run the tests once they're | 50 // [_globalDeclarer], and schedule a microtask to run the tests once they're |
51 // finished being defined. | 51 // finished being defined. |
52 _globalDeclarer = new Declarer(); | 52 _globalDeclarer = new Declarer(); |
53 scheduleMicrotask(() { | 53 scheduleMicrotask(() { |
54 var suite = | 54 var suite = |
55 new Suite(_globalDeclarer.tests, | 55 new Suite(_globalDeclarer.tests, |
56 path: p.prettyUri(Uri.base), | 56 path: p.prettyUri(Uri.base), |
57 platform: "VM") | 57 platform: "VM") |
58 .filter(TestPlatform.vm, os: currentOsGuess); | 58 .filter(TestPlatform.vm, os: currentOSGuess); |
59 // TODO(nweiz): Set the exit code on the VM when issue 6943 is fixed. | 59 // TODO(nweiz): Set the exit code on the VM when issue 6943 is fixed. |
60 new NoIoCompactReporter([suite], color: true).run(); | 60 new NoIoCompactReporter([suite], color: true).run(); |
61 }); | 61 }); |
62 return _globalDeclarer; | 62 return _globalDeclarer; |
63 } | 63 } |
64 | 64 |
65 // TODO(nweiz): This and other top-level functions should throw exceptions if | 65 // TODO(nweiz): This and other top-level functions should throw exceptions if |
66 // they're called after the declarer has finished declaring. | 66 // they're called after the declarer has finished declaring. |
67 /// Creates a new test case with the given description and body. | 67 /// Creates a new test case with the given description and body. |
68 /// | 68 /// |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 void setSoloTest(int id) {} | 182 void setSoloTest(int id) {} |
183 | 183 |
184 @deprecated | 184 @deprecated |
185 void enableTest(int id) {} | 185 void enableTest(int id) {} |
186 | 186 |
187 @deprecated | 187 @deprecated |
188 void disableTest(int id) {} | 188 void disableTest(int id) {} |
189 | 189 |
190 @deprecated | 190 @deprecated |
191 withTestEnvironment(callback()) => callback(); | 191 withTestEnvironment(callback()) => callback(); |
OLD | NEW |