| 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 test; | 5 library test; |
| 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/backend/test_platform.dart'; | 14 import 'src/backend/test_platform.dart'; |
| 15 import 'src/deprecated/configuration.dart'; | |
| 16 import 'src/deprecated/test_case.dart'; | |
| 17 import 'src/runner/reporter/no_io_compact.dart'; | 15 import 'src/runner/reporter/no_io_compact.dart'; |
| 18 import 'src/utils.dart'; | 16 import 'src/utils.dart'; |
| 19 | 17 |
| 20 export 'package:matcher/matcher.dart'; | 18 export 'package:matcher/matcher.dart'; |
| 21 | 19 |
| 22 export 'src/deprecated/configuration.dart'; | |
| 23 export 'src/deprecated/simple_configuration.dart'; | |
| 24 export 'src/deprecated/test_case.dart'; | |
| 25 export 'src/frontend/expect.dart'; | 20 export 'src/frontend/expect.dart'; |
| 26 export 'src/frontend/expect_async.dart'; | 21 export 'src/frontend/expect_async.dart'; |
| 27 export 'src/frontend/future_matchers.dart'; | 22 export 'src/frontend/future_matchers.dart'; |
| 28 export 'src/frontend/prints_matcher.dart'; | 23 export 'src/frontend/prints_matcher.dart'; |
| 29 export 'src/frontend/test_on.dart'; | 24 export 'src/frontend/test_on.dart'; |
| 30 export 'src/frontend/throws_matcher.dart'; | 25 export 'src/frontend/throws_matcher.dart'; |
| 31 export 'src/frontend/throws_matchers.dart'; | 26 export 'src/frontend/throws_matchers.dart'; |
| 32 | 27 |
| 33 /// The global declarer. | 28 /// The global declarer. |
| 34 /// | 29 /// |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 104 |
| 110 /// Handle an error that occurs outside of any test. | 105 /// Handle an error that occurs outside of any test. |
| 111 void handleExternalError(error, String message, [stackTrace]) { | 106 void handleExternalError(error, String message, [stackTrace]) { |
| 112 // TODO(nweiz): handle this better. | 107 // TODO(nweiz): handle this better. |
| 113 registerException(error, stackTrace); | 108 registerException(error, stackTrace); |
| 114 } | 109 } |
| 115 | 110 |
| 116 /// Registers an exception that was caught for the current test. | 111 /// Registers an exception that was caught for the current test. |
| 117 void registerException(error, [StackTrace stackTrace]) => | 112 void registerException(error, [StackTrace stackTrace]) => |
| 118 Invoker.current.handleError(error, stackTrace); | 113 Invoker.current.handleError(error, stackTrace); |
| 119 | |
| 120 // What follows are stubs for various top-level names supported by unittest | |
| 121 // 0.11.*. These are preserved for the time being for ease of migration, but | |
| 122 // should be removed before this is released as stable. | |
| 123 | |
| 124 @deprecated | |
| 125 typedef dynamic TestFunction(); | |
| 126 | |
| 127 @deprecated | |
| 128 Configuration testConfiguration = new Configuration(); | |
| 129 | |
| 130 @deprecated | |
| 131 bool formatStacks = true; | |
| 132 | |
| 133 @deprecated | |
| 134 bool filterStacks = true; | |
| 135 | |
| 136 @deprecated | |
| 137 String groupSep = ' '; | |
| 138 | |
| 139 @deprecated | |
| 140 void logMessage(String message) => print(message); | |
| 141 | |
| 142 @deprecated | |
| 143 final testCases = []; | |
| 144 | |
| 145 @deprecated | |
| 146 const int BREATH_INTERVAL = 200; | |
| 147 | |
| 148 @deprecated | |
| 149 TestCase get currentTestCase => null; | |
| 150 | |
| 151 @deprecated | |
| 152 const PASS = 'pass'; | |
| 153 | |
| 154 @deprecated | |
| 155 const FAIL = 'fail'; | |
| 156 | |
| 157 @deprecated | |
| 158 const ERROR = 'error'; | |
| 159 | |
| 160 @deprecated | |
| 161 void skip_test(String spec, TestFunction body) {} | |
| 162 | |
| 163 @deprecated | |
| 164 void solo_test(String spec, TestFunction body) => test(spec, body); | |
| 165 | |
| 166 @deprecated | |
| 167 void skip_group(String description, void body()) {} | |
| 168 | |
| 169 @deprecated | |
| 170 void solo_group(String description, void body()) => group(description, body); | |
| 171 | |
| 172 @deprecated | |
| 173 void filterTests(testFilter) {} | |
| 174 | |
| 175 @deprecated | |
| 176 void runTests() {} | |
| 177 | |
| 178 @deprecated | |
| 179 void ensureInitialized() {} | |
| 180 | |
| 181 @deprecated | |
| 182 void setSoloTest(int id) {} | |
| 183 | |
| 184 @deprecated | |
| 185 void enableTest(int id) {} | |
| 186 | |
| 187 @deprecated | |
| 188 void disableTest(int id) {} | |
| 189 | |
| 190 @deprecated | |
| 191 withTestEnvironment(callback()) => callback(); | |
| OLD | NEW |