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