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.runner.load_exception_suite; | 5 library test.runner.load_exception_suite; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
| 9 import '../backend/group.dart'; |
9 import '../backend/invoker.dart'; | 10 import '../backend/invoker.dart'; |
10 import '../backend/metadata.dart'; | 11 import '../backend/metadata.dart'; |
11 import '../backend/suite.dart'; | 12 import '../backend/suite.dart'; |
12 import 'load_exception.dart'; | 13 import 'load_exception.dart'; |
13 | 14 |
14 /// A test suite generated from a load exception. | 15 /// A test suite generated from a load exception. |
15 /// | 16 /// |
16 /// Load exceptions are exposed as test suites so that they can be presented | 17 /// Load exceptions are exposed as test suites so that they can be presented |
17 /// alongside successful tests. | 18 /// alongside successful tests. |
18 class LoadExceptionSuite extends Suite { | 19 class LoadExceptionSuite extends Suite { |
19 /// The exception that this suite exposes. | 20 /// The exception that this suite exposes. |
20 final LoadException exception; | 21 final LoadException exception; |
21 final StackTrace stackTrace; | 22 final StackTrace stackTrace; |
22 | 23 |
23 LoadExceptionSuite(LoadException exception, stackTrace) | 24 LoadExceptionSuite(LoadException exception, stackTrace) |
24 : exception = exception, | 25 : exception = exception, |
25 stackTrace = stackTrace, | 26 stackTrace = stackTrace, |
26 super([ | 27 super(new Group.root([ |
27 new LocalTest("load error", new Metadata(), | 28 new LocalTest("load error", new Metadata(), |
28 () => new Future.error(exception, stackTrace)) | 29 () => new Future.error(exception, stackTrace)) |
29 ], path: exception.path); | 30 ]), path: exception.path); |
30 } | 31 } |
OLD | NEW |