OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.test.utils; | 5 library test.test.utils; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
| 10 import 'package:test/src/backend/declarer.dart'; |
10 import 'package:test/src/backend/invoker.dart'; | 11 import 'package:test/src/backend/invoker.dart'; |
11 import 'package:test/src/backend/live_test.dart'; | 12 import 'package:test/src/backend/live_test.dart'; |
12 import 'package:test/src/backend/metadata.dart'; | 13 import 'package:test/src/backend/metadata.dart'; |
13 import 'package:test/src/backend/state.dart'; | 14 import 'package:test/src/backend/state.dart'; |
14 import 'package:test/src/backend/suite.dart'; | 15 import 'package:test/src/backend/suite.dart'; |
15 import 'package:test/src/runner/application_exception.dart'; | 16 import 'package:test/src/runner/application_exception.dart'; |
16 import 'package:test/src/runner/load_exception.dart'; | 17 import 'package:test/src/runner/load_exception.dart'; |
17 import 'package:test/src/util/remote_exception.dart'; | 18 import 'package:test/src/util/remote_exception.dart'; |
18 import 'package:test/test.dart'; | 19 import 'package:test/test.dart'; |
19 | 20 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 stopBlocking(value); | 274 stopBlocking(value); |
274 }); | 275 }); |
275 }); | 276 }); |
276 | 277 |
277 await liveTest.run(); | 278 await liveTest.run(); |
278 expectTestPassed(liveTest); | 279 expectTestPassed(liveTest); |
279 // Ensure that the outer test doesn't complete until the inner future | 280 // Ensure that the outer test doesn't complete until the inner future |
280 // completes. | 281 // completes. |
281 return future; | 282 return future; |
282 } | 283 } |
| 284 |
| 285 /// Runs [body] with a declarer and returns the declared entries. |
| 286 List<SuiteEntry> declare(void body()) { |
| 287 var declarer = new Declarer()..declare(body); |
| 288 return declarer.build(); |
| 289 } |
OLD | NEW |